From 03fc900183644dd16c7eab486d46f180f8303c4d Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 25 Aug 2024 21:36:58 +0530 Subject: [PATCH] Update checking for crossorigin attrs on img and video tags --- .../class-image-prioritizer-img-tag-visitor.php | 2 +- .../class-image-prioritizer-video-tag-visitor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php b/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php index 287e955f31..f3c6b8ee3b 100644 --- a/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php +++ b/plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php @@ -111,7 +111,7 @@ static function ( string $value ): bool { ); $crossorigin = $processor->get_attribute( 'crossorigin' ); - if ( is_string( $crossorigin ) ) { + if ( null !== $crossorigin ) { $link_attributes['crossorigin'] = 'use-credentials' === $crossorigin ? 'use-credentials' : 'anonymous'; } diff --git a/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php b/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php index a51b512e14..06bafdae0c 100644 --- a/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php +++ b/plugins/image-prioritizer/class-image-prioritizer-video-tag-visitor.php @@ -76,7 +76,7 @@ static function ( string $value ): bool { ); $crossorigin = $processor->get_attribute( 'crossorigin' ); - if ( is_string( $crossorigin ) ) { + if ( null !== $crossorigin ) { $link_attributes['crossorigin'] = 'use-credentials' === $crossorigin ? 'use-credentials' : 'anonymous'; }