Skip to content

Commit

Permalink
Issue #843; Use constants instead of string literals.
Browse files Browse the repository at this point in the history
On Thierry's suggestion,
As these were already stored in constants.
  • Loading branch information
Ryan Kienstra committed Feb 8, 2018
1 parent f8aeca8 commit 69317b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions includes/sanitizers/class-amp-base-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function remove_child( $child ) {
if ( method_exists( $child->parentNode, 'removeChild' ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar.
$child->parentNode->removeChild( $child ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar.
if ( isset( $this->args['mutation_callback'] ) ) {
call_user_func( $this->args['mutation_callback'], $child, 'removed' );
call_user_func( $this->args['mutation_callback'], $child, AMP_Validation_Utils::NODE_REMOVED );
}
}
}
Expand All @@ -341,7 +341,7 @@ public function remove_attribute( $node, $attribute ) {
if ( method_exists( $node, 'removeAttribute' ) ) {
$node->removeAttribute( $attribute );
if ( isset( $this->args['mutation_callback'] ) ) {
call_user_func( $this->args['mutation_callback'], $node, 'removed_attr', $attribute );
call_user_func( $this->args['mutation_callback'], $node, AMP_Validation_Utils::ATTRIBUTE_REMOVED, $attribute );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ private function sanitize_disallowed_attributes_in_node( $node, $attr_spec_list
foreach ( $attrs_to_remove as $attr ) {
$node->removeAttributeNode( $attr );
if ( isset( $this->args['mutation_callback'], $attr->name ) ) {
call_user_func( $this->args['mutation_callback'], $node, 'removed_attr', $attr->name );
call_user_func( $this->args['mutation_callback'], $node, AMP_Validation_Utils::ATTRIBUTE_REMOVED, $attr->name );
}
}
}
Expand Down

0 comments on commit 69317b8

Please sign in to comment.