From: Martin HasoĊˆ Date: Tue, 24 Apr 2012 08:24:52 +0000 (+0200) Subject: Fixed guess template info for PHP 5.2 X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=28bd30714b778badfd5c8917c875c41b0d015a68;p=web%2Fkonrad%2Ftwig.git Fixed guess template info for PHP 5.2 --- diff --git a/lib/Twig/Error.php b/lib/Twig/Error.php index e32c5c9..8ac2a2e 100644 --- a/lib/Twig/Error.php +++ b/lib/Twig/Error.php @@ -161,6 +161,8 @@ class Twig_Error extends Exception if (null === $this->filename) { $this->filename = $template->getTemplateName(); } + + break; } } @@ -172,7 +174,7 @@ class Twig_Error extends Exception $file = $r->getFileName(); $exceptions = array($e = $this); - while (method_exists($e, 'getPrevious') && $e = $e->getPrevious()) { + while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) { $exceptions[] = $e; }