removed json_encode call in Twig_Error when the filename is a string (to avoid the...
authorFabien Potencier <fabien.potencier@gmail.com>
Mon, 7 Nov 2011 19:00:46 +0000 (20:00 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Mon, 7 Nov 2011 19:00:46 +0000 (20:00 +0100)
lib/Twig/Error.php

index ed0836c..8c1c54b 100644 (file)
@@ -132,7 +132,7 @@ class Twig_Error extends Exception
         }
 
         if (null !== $this->filename) {
-            $this->message .= sprintf(' in %s', json_encode($this->filename));
+            $this->message .= sprintf(' in %s', is_string($this->filename) ? '"'.$this->filename.'"' : json_encode($this->filename));
         }
 
         if ($this->lineno >= 0) {