• Resolved david221

    (@david221)


    I don’t get it. I updated my website to version 4.4, and I’m getting this PHP error message at the top of my screen:

    Warning: substr() expects parameter 1 to be string, array given in /home/personal/public_html/wp-includes/functions.php on line 1674

    So I looked up code from that functions file and found this block of code. The line that’s bolded is supposed to be what’s causing the error.

    function wp_normalize_path( $path ) {
    $path = str_replace( ‘\\’, ‘/’, $path );
    $path = preg_replace( ‘|/+|’,’/’, $path );
    if ( ‘:’ === substr( $path, 1, 1 ) ) {
    $path = ucfirst( $path );
    }
    return $path;
    }

    It’s strange though. I made the backup to my local copy, and I had no problems.

    Any ideas?

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter david221

    (@david221)

    Well, what I’ve done at the moment I commented out that entire if statement and it has fixed that error. But I’d like to know whether or not it’s best practice, and I’m open for more secure solution, should there be one.

    Thread Starter david221

    (@david221)

    Okay, well I think I’m going to confirm that this is resolved now since I have solved the problem, I guess. I repeat, all I did was comment out that entire if statement that I highlighted, and the php error is gone.

    Hi David,

    I am experiencing the same problem. How did you comment out the code? I’d like to try the same thing. You can see my problem here> https://www.routefiftycampers.com

    Thank you!
    Debbie

    David, Debbie, same problem here in multiple sites of mine, but not all.

    Debbie you can comment out the line by typing /* before the line, and */ after the line. But I’m looking for a better way to resolve this.

    Thanks so much deltajo! I’ll give it a shot.

    Debbie you’re welcome. Commenting it out worked for me by the way.

    Hi All,

    I cannot seem to find this area and snippet of code. I downloaded an editor which brought up a whole other set of issues for me. Is there a place I can look within my WordPress Theme editor to find the code to block? My coding skills are very basic – obviously…. Thanks,
    Deb

    Debbie I accessed the file from the server, not from the WordPress editor. It’s in the wp-includes folder. To find line 1674, copy the file contents to TextPad or other text editor that enables you to see line numbers. Comment it out, save it, then upload the fixed file.

    There are lots of other ways of doing it too. Let me know if I can help.

    deltajo, where is the wp-includes folder? I have the text editor “brackets”. Thank you!
    Deb

    Debbie, Brackets is fine. But do you have server access? When WordPress is installed to a server it creates three folders including “wp-includes,” into which “functions.php” is placed. But you do need access to these server folders and files in order to edit them. WordPress Editor only shows theme files.

    I access my server through cPanel, for example. But you could also use an FTP app. You need to know your server username and password.

    Deactivating all of the plugins – then reactivating them one by one, will give you a heads up on which one might be the offending plugin. In this case, I had the same error showing up after updating to WP 4.4. The offending plugin was Juiz Last Tweet. I deactivated the plugin and the error is gone.

    JoyfulArt,

    Yes! Thanks! I was going to spend the weekend doing that but you saved me the time. I have Juiz Last Tweet, and that was the culprit.

    JoyfulArt! That did it. I too, had that plugin. Thanks so much for your help. You too, deltajo. So very helpful!

    Yay us!

    Yes i had the same problem and the bug exists in Juiz Last Tweet plugin, may be they are not updated with the new version.

    Thanks JoyfulArt

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘'Warning: substr() expects parameter 1 to be string' after update to WP 4.4’ is closed to new replies.