Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c6da5e

Browse files
bug #53967 [ErrorHandler] return the unchanged text if preg_replace_callback() fails (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [ErrorHandler] return the unchanged text if preg_replace_callback() fails | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #51290 | License | MIT Commits ------- db47893 return the unchanged text if preg_replace_callback() fails
2 parents 45c63b2 + db47893 commit 9c6da5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ private function formatFileFromText(string $text)
329329
{
330330
return preg_replace_callback('/in ("|")?(.+?)\1(?: +(?:on|at))? +line (\d+)/s', function ($match) {
331331
return 'in '.$this->formatFile($match[2], $match[3]);
332-
}, $text);
332+
}, $text) ?? $text;
333333
}
334334

335335
private function formatLogMessage(string $message, array $context)

0 commit comments

Comments
 (0)