Skip to content

Commit

Permalink
Eliminate unused AMP_Rule_Spec::$additional_allowed_tags
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Nov 26, 2019
1 parent 545611e commit a2ff9d1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
14 changes: 0 additions & 14 deletions includes/sanitizers/class-amp-rule-spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,4 @@ abstract class AMP_Rule_Spec {
'typemustmatch',
'visible',
];

/**
* Additional allowed tags.
*
* @var array
*/
public static $additional_allowed_tags = [

// An experimental tag with no protoascii.
'amp-share-tracking' => [
'attr_spec_list' => [],
'tag_spec' => [],
],
];
}
8 changes: 0 additions & 8 deletions includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,11 @@ public function __construct( $dom, $args = [] ) {
];
}

// Prepare whitelists.
foreach ( AMP_Rule_Spec::$additional_allowed_tags as $tag_name => $tag_rule_spec ) {
$this->allowed_tags[ $tag_name ][] = $tag_rule_spec;
}

// @todo Do the same for body when !use_document_element?
if ( ! empty( $this->args['use_document_element'] ) ) {
foreach ( $this->allowed_tags['html'] as &$rule_spec ) {
unset( $rule_spec[ AMP_Rule_Spec::TAG_SPEC ][ AMP_Rule_Spec::MANDATORY_PARENT ] );
}

unset( $rule_spec );
}

Expand All @@ -234,10 +228,8 @@ public function __construct( $dom, $args = [] ) {
$tag_spec[ AMP_Rule_Spec::ATTR_SPEC_LIST ] = $this->process_alternate_names( $tag_spec[ AMP_Rule_Spec::ATTR_SPEC_LIST ] );
}
}

unset( $tag_spec );
}

unset( $tag_specs );

$this->globally_allowed_attributes = $this->process_alternate_names( $this->globally_allowed_attributes );
Expand Down

0 comments on commit a2ff9d1

Please sign in to comment.