8000 [ErrorHandler] Do not transform file to link if it does not exist · symfony/symfony@2dfac6b · GitHub
[go: up one dir, main page]

Skip to content

Commit 2dfac6b

Browse files
committed
[ErrorHandler] Do not transform file to link if it does not exist
1 parent b433305 commit 2dfac6b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ private function formatFile(string $file, int $line, ?string $text = null): stri
231231
$text .= ' at line '.$line;
232232
}
233233

234+
if (!file_exists($file)) {
235+
return $text;
236+
}
237+
234238
$link = $this->fileLinkFormat->format($file, $line);
235239

236240
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', $this->escape($link), $text);

0 commit comments

Comments
 (0)
0