From a2ff9d1e9ef6c634bd69400c8ae44133a502ec64 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 25 Nov 2019 22:38:01 -0800 Subject: [PATCH] Eliminate unused AMP_Rule_Spec::$additional_allowed_tags --- includes/sanitizers/class-amp-rule-spec.php | 14 -------------- .../class-amp-tag-and-attribute-sanitizer.php | 8 -------- 2 files changed, 22 deletions(-) diff --git a/includes/sanitizers/class-amp-rule-spec.php b/includes/sanitizers/class-amp-rule-spec.php index 55472a50610..aea75d30917 100644 --- a/includes/sanitizers/class-amp-rule-spec.php +++ b/includes/sanitizers/class-amp-rule-spec.php @@ -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' => [], - ], - ]; } diff --git a/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php b/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php index cd6a2141e37..59be2d7e3a2 100644 --- a/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php +++ b/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php @@ -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 ); } @@ -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 );