Issue Bug Rejected

#31478wrong array check leads leads to segmentation fault in PHP

Tim Wentzlau 11/01/11, 01:39 updated 12/12/14, 19:32

Description

In classes.t3lib.parsehtml.php in line 250 there is a wrong check of the array size.

if (count($wrapArr) > 0) {
    $marker = $wrapArr[0] . $marker . $wrapArr[1];
}

if count($wrapArr) returns 1 then php fails with segmentation fault when trying to access $wrapArr1, as there is no element there.

The segmentation fault must be a php bug, but can be circumvented with this fix:

if (count($wrapArr) > 1) {
    $marker = $wrapArr[0] . $marker . $wrapArr[1];
} 

Reviews 1