45 $this->safeVars = array();
47 $this->statusStack[] = $node->getAttribute(
'value');
49 $this->statusStack[] = isset($this->blocks[$node->getAttribute(
'name')]) ? $this->blocks[$node->getAttribute(
'name')] : $this->
needEscaping($env);
51 $this->safeVars[] = $node->getNode(
'var')->getAttribute(
'name');
68 $this->defaultStrategy =
false;
69 $this->safeVars = array();
77 array_pop($this->statusStack);
79 $this->blocks[$node->getAttribute(
'name')] = $this->
needEscaping($env);
87 if (
false === $type) {
91 $expression = $node->
getNode(
'expr');
93 if ($this->
isSafeFor($type, $expression, $env)) {
107 $name = $filter->
getNode(
'filter')->getAttribute(
'value');
109 $type = $env->
getFilter($name)->getPreEscape();
110 if (null === $type) {
114 $node = $filter->
getNode(
'node');
115 if ($this->
isSafeFor($type, $node, $env)) {
126 $safe = $this->safeAnalysis->getSafe($expression);
128 if (null === $safe) {
129 if (null === $this->traverser) {
133 $this->safeAnalysis->setSafeVars($this->safeVars);
135 $this->traverser->traverse($expression);
136 $safe = $this->safeAnalysis->getSafe($expression);
139 return in_array($type, $safe) || in_array(
'all', $safe);
144 if (count($this->statusStack)) {
145 return $this->statusStack[count($this->statusStack) - 1];
148 return $this->defaultStrategy ? $this->defaultStrategy :
false;
Twig_NodeTraverser is a node traverser.
setNode($name, $node=null)
Sets a node.
getPriority()
{Returns the priority for this visitor.Priority should be between -10 and 10 (0 is the default)...
if($rub=fetch_assoc($rub_query)) if(check_if_module_active('url_rewriting')) $class
getFilter($name)
Get a filter by name.
Represents a node in the AST.
enterNode(Twig_NodeInterface $node, Twig_Environment $env)
Called before child nodes are visited.
isSafeFor($type, Twig_NodeInterface $expression, $env)
Represents a block call node.
escapePrintNode(Twig_Node_Print $node, Twig_Environment $env, $type)
Represents an autoescape node.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Represents a module node.
getEscaperFilter($type, Twig_NodeInterface $node)
Represents an import node.
getExtension($name)
Gets an extension by name.
Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.
Represents a node in the AST.
hasExtension($name)
Returns true if the given extension is registered.
Twig_NodeVisitor_Escaper implements output escaping.
preEscapeFilterNode(Twig_Node_Expression_Filter $filter, Twig_Environment $env)
Stores the Twig configuration.
leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
Called after child nodes are visited.
needEscaping(Twig_Environment $env)
getNode($name)
Gets a node by name.
Represents a node that outputs an expression.