Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4da44ef

Browse filesBrowse files
committed
bug #60571 [ErrorHandler] Do not transform file to link if it does not exist (lyrixx)
This PR was merged into the 6.4 branch. Discussion ---------- [ErrorHandler] Do not transform file to link if it does not exist | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT see twigphp/Twig#4643 Commits ------- 2dfac6b [ErrorHandler] Do not transform file to link if it does not exist
2 parents b433305 + 2dfac6b commit 4da44ef
Copy full SHA for 4da44ef

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php
+4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.