Permalink
Browse files

[FrameworkBundle] removed links in exceptions when the file does not …

…exist (mostly useful because of shortcut notations for templates)
  • Loading branch information...
1 parent b68624a commit d873f21f69c9d4706658b4d938ad584743d44dc3 @fabpot fabpot committed Apr 12, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php
@@ -189,7 +189,11 @@ public function formatFile($file, $line, $text = null)
*/
public function getFileLink($file, $line)
{
- return $this->fileLinkFormat ? strtr($this->fileLinkFormat, array('%f' => $file, '%l' => $line)) : false;
+ if ($this->fileLinkFormat && file_exists($file)) {
+ return strtr($this->fileLinkFormat, array('%f' => $file, '%l' => $line));
+ }
+
+ return false;
}
public function formatFileFromText($text)

0 comments on commit d873f21

Please sign in to comment.