From 28bd30714b778badfd5c8917c875c41b0d015a68 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Haso=C5=88?= Date: Tue, 24 Apr 2012 10:24:52 +0200 Subject: [PATCH] Fixed guess template info for PHP 5.2 --- lib/Twig/Error.php | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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; } -- 1.7.2.5