Skip to content

Commit 7978929

Browse files
author
joseph lenton
committed
JosephLenton#18 fixed 5.3 issues, code was using a 5.4 feature
$this is not accessible withint closures in 5.3, and the code was accessing them.
1 parent 8bd6af3 commit 7978929

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/php_error.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,6 +2883,7 @@ private function displayError( $message, $errLine, $errFile, $errFileType, $stac
28832883
$serverName = $this->serverName;
28842884
$backgroundText = $this->backgroundText;
28852885
$requestUrl = str_replace( $_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI'] );
2886+
$displayLineNumber = $this->displayLineNumber;
28862887

28872888
$this->displayHTML(
28882889
// pre, in the head
@@ -2899,6 +2900,7 @@ function() use (
28992900
$backgroundText, $serverName, $applicationRoot,
29002901
$message, $errLine, $errFile, $errFileType, $stackTrace,
29012902
&$fileLinesSets, $numFileLines,
2903+
$displayLineNumber,
29022904
$dumpInfo
29032905
) {
29042906
if ( $backgroundText ) { ?>
@@ -2927,9 +2929,9 @@ function() use (
29272929
$show = $fileLinesSet->isShown();
29282930
$highlightLine = $fileLinesSet->getLine();
29292931

2930-
// calculate last line number length
2931-
end($fileLines);
2932-
$maxLineNumber = key($fileLines);
2932+
// calculate last line number length
2933+
end($fileLines);
2934+
$maxLineNumber = key($fileLines);
29332935
$lineDecimals = strlen($maxLineNumber);
29342936
?>
29352937
<div id="<?php echo $id ?>" class="error-file-lines <?php echo $show ? 'show' : '' ?>">
@@ -2945,15 +2947,15 @@ function() use (
29452947
$line = "&nbsp;$line";
29462948
}
29472949

2948-
if ($this->displayLineNumber) {
2949-
$lineNumLabel = str_replace(' ', '&nbsp;', sprintf("%{$lineDecimals}d", $lineNum));
2950+
if ($displayLineNumber) {
2951+
$lineNumLabel = str_replace(' ', '&nbsp;', sprintf("%{$lineDecimals}d", $lineNum));
29502952
} else {
2951-
$lineNumLabel = '';
2953+
$lineNumLabel = '';
29522954
}
29532955

29542956
?><div <?php echo $style ?> class="error-file-line <?php echo ($lineNum === $highlightLine) ? 'highlight' : '' ?>">
2955-
<span class="error-file-line-number"><?php echo $lineNumLabel ?></span>
2956-
<span class="error-file-line-content"><?php echo $line ?></span>
2957+
<span class="error-file-line-number"><?php echo $lineNumLabel ?></span>
2958+
<span class="error-file-line-content"><?php echo $line ?></span>
29572959
</div>
29582960
<?php
29592961
}

0 commit comments

Comments
 (0)