• Hi,
    after upgrade to wordpress 4.4.1 in my error_log_php file I found a lot of these errors:

    PHP Warning: strpos() [function.strpos]: Empty needle in /home/****/public_html/wp-includes/media.php on line 1088

    What is it?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • From the PHP Manual, the “strpos” determines the position of a string. It looks like this:

    strpos ( string $haystack , $needle [, int $offset = 0 ] )

    At line 1088 in media.php you have this:

    // If the file name is part of thesrc, we've confirmed a match.
    if ( ! $src_matched && false !== strpos( $image_src, $dirname . $image[‘file’] ) ) {`
    $src_matched = true;
    }

    So the $needle is the $dirname. That means that the folder where the media is located cannot be found. It’s most likely a bug, because no errors are thrown, only warnings.

    Thread Starter collare

    (@collare)

    Hi,
    thank you for answer.
    I hope in a new wordpress update.

    Editing wp-config and including the following line did it for me:

    @ini_set('display_errors', 0);

    Blogged: WordPress Error “Empty needle” in media.php Line 1088. How to Hide the Warning Message in Web Pages?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem PHP Warning: strpos’ is closed to new replies.