فهرست منبع

[FrameworkBundle] removed links in exceptions when the file does not exist (mostly useful because of shortcut notations for templates)

Fabien Potencier 14 سال پیش
والد
کامیت
d873f21f69
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

+ 5 - 1
src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

@@ -189,7 +189,11 @@ class CodeHelper extends Helper
      */
     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)