diff --git a/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php b/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php index e3b707f555c..aac823f191a 100644 --- a/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php +++ b/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php @@ -2466,10 +2466,6 @@ private function remove_disallowed_descendants( DOMElement $node, $allowed_desce * @param string $spec_name Spec name. */ private function remove_disallowed_siblings( DOMElement $node, $spec_name ) { - if ( ! $node->previousSibling && ! $node->nextSibling ) { - return; - } - $prev_sibling = $node->previousSibling; while ( null !== $prev_sibling ) { $prev_prev_sibling = $prev_sibling->previousSibling;