From 980375ca2eaabad974b1602ab0291645eb0e0f78 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 13 Nov 2019 12:23:11 -0800 Subject: [PATCH] Use length property instead of count() method on DOMNodeList (#3727) --- includes/sanitizers/class-amp-core-theme-sanitizer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/sanitizers/class-amp-core-theme-sanitizer.php b/includes/sanitizers/class-amp-core-theme-sanitizer.php index 83069132838..8518f8d3db8 100644 --- a/includes/sanitizers/class-amp-core-theme-sanitizer.php +++ b/includes/sanitizers/class-amp-core-theme-sanitizer.php @@ -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; } @@ -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; }