Security update to Drupal 8.4.6
[yaffs-website] / vendor / twig / twig / lib / Twig / NodeVisitor / Sandbox.php
index b631b29d4d15ec8efee53999acf14c7fd007d5c5..71aa4f029b4b99dd753e80a96a709a3d5eb27053 100644 (file)
@@ -48,6 +48,11 @@ class Twig_NodeVisitor_Sandbox extends Twig_BaseNodeVisitor
                 $this->functions[$node->getAttribute('name')] = $node;
             }
 
+            // the .. operator is equivalent to the range() function
+            if ($node instanceof Twig_Node_Expression_Binary_Range && !isset($this->functions['range'])) {
+                $this->functions['range'] = $node;
+            }
+
             // wrap print to check __toString() calls
             if ($node instanceof Twig_Node_Print) {
                 return new Twig_Node_SandboxedPrint($node->getNode('expr'), $node->getTemplateLine(), $node->getNodeTag());