protected function checkVariableDeclaration(DOMNode $node, $tag, $query)
	{
		$query = 'ancestor-or-self::*/preceding-sibling::' . $query . '[@select]';
		$xpath = new DOMXPath($node->ownerDocument);
		foreach ($xpath->query($query, $node) as $varNode)
		{
			// Intercept the UnsafeTemplateException and change the node to the one we're
			// really checking before rethrowing it
			try
			{
				$this->checkExpression($varNode, $varNode->getAttribute('select'), $tag);
			}
			catch (UnsafeTemplateException $e)
			{
				$e->setNode($node);

				throw $e;
			}
		}
	}
protected function checkVariableDeclaration(DOMNode $node, $tag, $query)
	{
		$query = 'ancestor-or-self::*/preceding-sibling::' . $query . '[@select]';
		$xpath = new DOMXPath($node->ownerDocument);
		foreach ($xpath->query($query, $node) as $varNode)
		{
			// Intercept the UnsafeTemplateException and change the node to the one we're
			// really checking before rethrowing it
			try
			{
				$this->checkExpression($varNode, $varNode->getAttribute('select'), $tag);
			}
			catch (UnsafeTemplateException $e)
			{
				$e->setNode($node);

				throw $e;
			}
		}
	}
protected function checkVariableDeclaration ( DOMNode $ node , $ tag , $ query ) { $ query = 'ancestor-or-self::*/preceding-sibling::' . $ query . '[@select]' ; $ xpath = new DOMXPath ( $ node -> ownerDocument ) ; foreach ( $ xpath -> query ( $ query , $ node ) as $ varNode ) { // Intercept the UnsafeTemplateException and change the node to the one we're // really checking before rethrowing it try { $ this -> checkExpression ( $ varNode , $ varNode -> getAttribute ( 'select' ) , $ tag ) ; } catch ( UnsafeTemplateException $ e ) { $ e -> setNode ( $ node ) ; throw $ e ; } } }
Check whether a variable declaration is safe in context

@param  DOMNode $node  Context node
@param  Tag     $tag   Source tag
@param  string  $query XPath query
@return void
Check whether a variable declaration is safe in context