Make WordPress Core

Ticket #56791: str_contains.patch

File str_contains.patch, 572 bytes (added by TobiasBg, 17 months ago)

See ticket:56969#comment:35 .

  • src/wp-includes/media.php

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