protected function checkAttribute(DOMNode $node, Tag $tag, $attrName)
	{
		// Test whether the attribute exists
		if (!isset($tag->attributes[$attrName]))
		{
			if ($this->ignoreUnknownAttributes)
			{
				return;
			}

			throw new UnsafeTemplateException("Cannot assess the safety of unknown attribute '" . $attrName . "'", $node);
		}

		// Test whether the attribute is safe to be used in this content type
		if (!$this->tagFiltersAttributes($tag) || !$this->isSafe($tag->attributes[$attrName]))
		{
			throw new UnsafeTemplateException("Attribute '" . $attrName . "' is not properly sanitized to be used in this context", $node);
		}
	}
protected function checkAttribute(DOMNode $node, Tag $tag, $attrName)
	{
		// Test whether the attribute exists
		if (!isset($tag->attributes[$attrName]))
		{
			if ($this->ignoreUnknownAttributes)
			{
				return;
			}

			throw new UnsafeTemplateException("Cannot assess the safety of unknown attribute '" . $attrName . "'", $node);
		}

		// Test whether the attribute is safe to be used in this content type
		if (!$this->tagFiltersAttributes($tag) || !$this->isSafe($tag->attributes[$attrName]))
		{
			throw new UnsafeTemplateException("Attribute '" . $attrName . "' is not properly sanitized to be used in this context", $node);
		}
	}
protected function checkAttribute ( DOMNode $ node , Tag $ tag , $ attrName ) { // Test whether the attribute exists if ( ! isset ( $ tag -> attributes [ $ attrName ] ) ) { if ( $ this -> ignoreUnknownAttributes ) { return ; } throw new UnsafeTemplateException ( "Cannot assess the safety of unknown attribute '" . $ attrName . "'" , $ node ) ; } // Test whether the attribute is safe to be used in this content type if ( ! $ this -> tagFiltersAttributes ( $ tag ) || ! $ this -> isSafe ( $ tag -> attributes [ $ attrName ] ) ) { throw new UnsafeTemplateException ( "Attribute '" . $ attrName . "' is not properly sanitized to be used in this context" , $ node ) ; } }
Test whether a tag attribute is safe

@param  DOMNode $node     Context node
@param  Tag     $tag      Source tag
@param  string  $attrName Name of the attribute
@return void
Test whether a tag attribute is safe