From: Fabien Potencier Date: Tue, 14 Dec 2010 08:08:17 +0000 (+0100) Subject: fixed filename not being added to syntax error messages X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=8f33ca71118ea5866f06deaba76c4120c0f3d88c;p=web%2Fkonrad%2Ftwig.git fixed filename not being added to syntax error messages --- diff --git a/CHANGELOG b/CHANGELOG index 87d087f..e4b4d2d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,7 @@ Backward incompatibilities: Changes: + * fixed filename not being added to syntax error messages * added the autoescape option to enable/disable autoescaping * removed the newline after a comment (mimicks PHP behavior) * added a syntax error exception when parent block is used on a template that does not extend another one diff --git a/lib/Twig/Error.php b/lib/Twig/Error.php index e9b60c3..6eb9130 100644 --- a/lib/Twig/Error.php +++ b/lib/Twig/Error.php @@ -21,7 +21,7 @@ class Twig_Error extends Exception protected $filename; protected $rawMessage; - public function __construct($message, $lineno = -1, $filename = 'n/a') + public function __construct($message, $lineno = -1, $filename = null) { $this->lineno = $lineno; $this->filename = $filename; @@ -48,7 +48,7 @@ class Twig_Error extends Exception { $this->message = $this->rawMessage; - if ('n/a' != $this->filename) { + if (null !== $this->filename) { $this->message .= sprintf(' in %s', $this->filename); }