8000 [FrameworkBundle] removed links in exceptions when the file does not … · dpb587/symfony@d873f21 · GitHub
[go: up one dir, main page]

Skip to content

Commit d873f21

Browse files
committed
[FrameworkBundle] removed links in exceptions when the file does not exist (mostly useful because of shortcut notations for templates)
1 parent b68624a commit d873f21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ public function formatFile($file, $line, $text = null)
189189
*/
190190
public function getFileLink($file, $line)
191191
{
192-
return $this->fileLinkFormat ? strtr($this->fileLinkFormat, array('%f' => $file, '%l' => $line)) : false;
192+
if ($this->fileLinkFormat && file_exists($file)) {
193+
return strtr($this->fileLinkFormat, array('%f' => $file, '%l' => $line));
194+
}
195+
196+
return false;
193197
}
194198

195199
public function formatFileFromText($text)

0 commit comments

Comments
 (0)
0