mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 04:16:28 +00:00
fixed filename not being added to syntax error messages
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user