From 9c48084f3b5064d580a5c88a6fe9170599cf8879 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 19 Sep 2013 16:08:25 +1000 Subject: upgrade twig library --- inc/lib/Twig/Error.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 inc/lib/Twig/Error.php (limited to 'inc/lib/Twig/Error.php') diff --git a/inc/lib/Twig/Error.php b/inc/lib/Twig/Error.php old mode 100644 new mode 100755 index 72d91a98..61a4cfa0 --- a/inc/lib/Twig/Error.php +++ b/inc/lib/Twig/Error.php @@ -186,6 +186,7 @@ class Twig_Error extends Exception protected function guessTemplateInfo() { $template = null; + $templateClass = null; if (version_compare(phpversion(), '5.3.6', '>=')) { $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); @@ -195,8 +196,11 @@ class Twig_Error extends Exception foreach ($backtrace as $trace) { if (isset($trace['object']) && $trace['object'] instanceof Twig_Template && 'Twig_Template' !== get_class($trace['object'])) { - if (null === $this->filename || $this->filename == $trace['object']->getTemplateName()) { + $currentClass = get_class($trace['object']); + $isEmbedContainer = 0 === strpos($templateClass, $currentClass); + if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) { $template = $trace['object']; + $templateClass = get_class($trace['object']); } } } -- cgit v1.3