diff --git src/wp-includes/media.php src/wp-includes/media.php
index 804a34f6ac..89a7abac02 100644
--- src/wp-includes/media.php
+++ src/wp-includes/media.php
@@ -1964,7 +1964,7 @@ function wp_img_tag_add_loading_attr( $image, $context ) {
 function wp_img_tag_add_decoding_attr( $image, $context ) {
 	// Only apply the decoding attribute to images that have a src attribute that
 	// starts with a double quote, ensuring escaped JSON is also excluded.
-	if ( false === strpos( $image, ' src="' ) ) {
+	if ( ! str_contains( $image, ' src="' ) ) {
 		return $image;
 	}
 
