summaryrefslogtreecommitdiff
path: root/inc/lib/Twig/Error.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-11-11 21:54:35 +0100
committerczaks <marcin@6irc.net>2013-11-11 21:54:35 +0100
commitf5657caf24753ed7c25d56659ae8dfe79d48b99a (patch)
tree989f1149070194f18f6250c851159dda813151fe /inc/lib/Twig/Error.php
parent0a58973631626879abeea4956b33cc2b56dea453 (diff)
parent9fb63b053fbb552a2a8bbde1e230a8b73296fb6d (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard into vichan-devel-4.5
Conflicts: inc/config.php install.php post.php stylesheets/style.css
Diffstat (limited to 'inc/lib/Twig/Error.php')
-rw-r--r--inc/lib/Twig/Error.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/lib/Twig/Error.php b/inc/lib/Twig/Error.php
index 72d91a98..61a4cfa0 100644
--- 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']);
}
}
}