Explorar o código

fixed array support in twig globals

Lukas Kahwe Smith %!s(int64=14) %!d(string=hai) anos
pai
achega
26666a272d

+ 1 - 1
src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

@@ -78,7 +78,7 @@ class TwigExtension extends Extension
             }
         } else {
             foreach ($globals as $key => $value) {
-                if ('@' === substr($value, 0, 1)) {
+                if (is_string($value) && '@' === substr($value, 0, 1)) {
                     $def->addMethodCall('addGlobal', array($key, new Reference(substr($value, 1))));
                 } else {
                     $def->addMethodCall('addGlobal', array($key, $value));