From a1b7ec56e6dfc94977e9000ab1567beee8ab3239 Mon Sep 17 00:00:00 2001 From: Eugene Leonovich Date: Wed, 16 Jan 2013 09:40:49 +0100 Subject: [PATCH] Tweak twig_constant() --- lib/Twig/Extension/Core.php | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 2110120..c1a37d8 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -1267,10 +1267,9 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a */ function twig_constant($constant, $object = null) { - if (!$object) { - return constant($constant); + if ($object) { + $constant = get_class($object).'::'.$constant; } - $class = get_class($object); - return constant($class.'::'.$constant); + return constant($constant); } -- 1.7.2.5