Skip to content

Commit

Permalink
Use length property instead of count() method on DOMNodeList (#3727)
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter authored Nov 13, 2019
1 parent 90c21b1 commit 980375c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/sanitizers/class-amp-core-theme-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ public function wrap_modal_in_lightbox( $args = [] ) {
public function add_twentytwenty_modals() {
$modals = $this->xpath->query( "//*[ @class and contains( concat( ' ', normalize-space( @class ), ' ' ), ' cover-modal ' ) ]" );

if ( false === $modals || 0 === $modals->count() ) {
if ( false === $modals || 0 === $modals->length ) {
return;
}

Expand Down Expand Up @@ -1672,7 +1672,7 @@ public function add_twentytwenty_toggles() {
$toggles = $this->xpath->query( '//*[ @data-toggle-target ]' );
$body_id = AMP_DOM_Utils::get_element_id( $this->get_body_node(), 'body' );

if ( false === $toggles || 0 === $toggles->count() ) {
if ( false === $toggles || 0 === $toggles->length ) {
return;
}

Expand Down

0 comments on commit 980375c

Please sign in to comment.