Skip to content

Commit

Permalink
Capture first
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Aug 3, 2023
1 parent 21f8f6f commit 7b6ce5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2472,6 +2472,7 @@ private function remove_disallowed_siblings( DOMElement $node, $spec_name ) {

$prev_sibling = $node->previousSibling;
while ( null !== $prev_sibling ) {
$prev_prev_sibling = $prev_sibling->previousSibling;
if ( $prev_sibling instanceof Element ) {
$this->remove_invalid_child(
$prev_sibling,
Expand All @@ -2482,11 +2483,12 @@ private function remove_disallowed_siblings( DOMElement $node, $spec_name ) {
]
);
}
$prev_sibling = $prev_sibling->previousSibling;
$prev_sibling = $prev_prev_sibling;
}

$next_sibling = $node->nextSibling;
while ( null !== $next_sibling ) {
$next_next_sibling = $next_sibling->nextSibling;
if ( $next_sibling instanceof Element ) {
$this->remove_invalid_child(
$next_sibling,
Expand All @@ -2497,7 +2499,7 @@ private function remove_disallowed_siblings( DOMElement $node, $spec_name ) {
]
);
}
$next_sibling = $next_sibling->nextSibling;
$next_sibling = $next_next_sibling;
}
}

Expand Down

0 comments on commit 7b6ce5f

Please sign in to comment.