WordPress.org

Ready to get started?Download WordPress

Forums

Warning: strtolower() expects parameter (6 posts)

  1. JTVaughn
    Member
    Posted 2 years ago #

    Getting this error when trying to update pages.

    Warning: strtolower() expects parameter 1 to be string, array given in /home/mzptv/public_html/wp-includes/formatting.php on line 772

    Warning: Cannot modify header information - headers already sent by (output started at /home/mzptv/public_html/wp-includes/formatting.php:772) in /home/mzptv/public_html/wp-includes/pluggable.php on line 934

    I've done a search and read the other support topics about "Cannot modify header information", and I've tried removing spaces from pluggable.php, formatting.php, header.php and wp-config.php, but the error remains.

    Line 772 of formatting.php is --

    $key = strtolower( $key );

    The line in context is --

    function sanitize_key( $key ) {
    	$raw_key = $key;
    	$key = strtolower( $key );
    	$key = preg_replace( '/[^a-z0-9_\-]/', '', $key );
    	return apply_filters( 'sanitize_key', $key, $raw_key );
    }

    Let me know if there's any other code I can drop on paste bin to help fix this. I'm a PHP newb.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    $key must be an array - not a string.

  3. JTVaughn
    Member
    Posted 2 years ago #

    In plain English? :-D

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

  5. JTVaughn
    Member
    Posted 2 years ago #

    So... what's the fix for the problem? Maybe I exaggerated saying PHP newb -- I meant I have no clue about PHP.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Don't edit core code - ever. Try:
    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Eleven theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

Topic Closed

This topic has been closed to new replies.

About this Topic