AMP_Base_Sanitizer::remove_invalid_attribute

AMP_Base_Sanitizer::remove_invalid_attribute( DOMElement $element,  DOMAttr|string $attribute,  array $validation_error = array(),  array $attr_spec = array() )

Description #

Removes an invalid attribute of a node.

Also, calls the mutation callback for it. This tracks all the attributes that were removed.


Parameters #

$element

(DOMElement) (Required) The node for which to remove the attribute.

$attribute

(DOMAttr|string) (Required) The attribute to remove from the element.

$validation_error

(array) (Optional) Validation error details.

Default value:array()

$attr_spec

(array) (Optional) Attribute spec.

Default value:array()


Return #

(bool) Whether the node should have been removed, that is, that the node was sanitized for validity.


Changelog #

Changelog
Version Description
0.7 Introduced.