• Resolved DinaG

    (@dinag)


    Hi

    I updated to 3.6 and now have an error in the header:

    Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/thth3970/public_html/wp-includes/functions.php on line 2871

    I also see this at the top of my admin pages and blog, any suggestions?
    thanks
    https://www.thatcreativefeeling.com

Viewing 15 replies - 1 through 15 (of 16 total)
  • This is a security-related deprecation. May be you have some plugin that is triggering this.

    Temporary solution (you must find the Plugin creating the issue) :

    To make this notice does not appear, change the lines in the file wp-config.php via FTP :

    define ('WP_DEBUG', false);

    Moderator t-p

    (@t-p)

    Also, have you reviewed this thread and attempted troubleshooting steps recommended therein: https://www.ads-software.com/support/topic/troubleshooting-wordpress-36-master-list

    Thread Starter DinaG

    (@dinag)

    Thanks, this morning I tried to enter the dashboard to go through the suggestions above but now I cant access the dashboard.

    It gives me a white screen with these errors below. How do I enter admin now?

    Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/thth3970/public_html/wp-includes/functions.php on line 2871

    Warning: Cannot modify header information – headers already sent by (output started at /home/thth3970/public_html/wp-includes/functions.php:2871) in /home/thth3970/public_html/wp-login.php on line 384

    Warning: Cannot modify header information – headers already sent by (output started at /home/thth3970/public_html/wp-includes/functions.php:2871) in /home/thth3970/public_html/wp-login.php on line 396

    Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/thth3970/public_html/wp-includes/functions.php on line 2871

    @dinag – try using FTP access to deactivate all plugins by changing the name on the plugins folder :

    wp-content
        pluginsHOLD

    Moderator t-p

    (@t-p)

    Thread Starter DinaG

    (@dinag)

    Alrighty, got in via FTP, deactivated the plugins and found the culprit.
    ‘Better WP Security’

    thanks

    Hello,
    I have a very similar error message.

    Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /Users/carlorizzante/Dropbox/Development/vhosts/factory.dev/wp-includes/functions.php on line 2876

    It appeared after the automatic update to WordPress 3.6. I am not sure about what version I had before, but usually I perform an update session on a daily base if available for all components.

    I deactivated all plugins and themes, and I also tried to rename the two folders for themes and plugins as well in “theme-old” and “plugins-old”. However, the error persists.

    I searched inside all the files for “wpdb::escape” and I not found any.

    I also downloaded from www.ads-software.com the zip file of WordPress 3.6, and I copied all files (overwriting all). It did not fix the issue.

    So I am now clueless. Any suggestions? ??

    Found it.

    First of all, I was searching for the wrong line of code, wpdb::escape.

    The string to look for is $wpdb->escape.

    It is a little bit everywhere, mainly plugins.

    In my case, it was in the file sunrise.php. In fact, commenting the following line in wp-config.php, makes the error disappear.

    // define('SUNRISE', 'on');

    However, I suppose that the solution is to fix the file sunrise.php itself.

    Unfortunately, esc_sql() can’t be used, since apparently sunrise.php is been included before the function esc_sql() is even registered.

    So, I looked up into esc_sql().

    function esc_sql( $data ) {
    	global $wpdb;
    	return $wpdb->_escape( $data );
    }

    Therefore, in sunrise.php, I commented the original line that causes the trouble, and duplicated it right below, modifying it as such:

    // $dm_domain = $wpdb->escape( $_SERVER[ 'HTTP_HOST' ] );
    $dm_domain = $wpdb->_escape( $_SERVER[ 'HTTP_HOST' ] );

    So far, so good. Hopefully this will help others somehow.

    @carlorizzante : Wuaw!!! thaaanks man!! Lifesaver

    I confirm Carlo Rizzante solution, thank you.

    @carlorizzante you’re the man!

    @carlorizzante: Thank you very much for your solution.

    Master stroke, @carlorizzante, master stroke!

    bravo, gazillion thanks :o)

    @carlorizzante saved the day!

    I sent the fix to WP Engine. Hopefully they’ll be able to fix for all our multisites.

    Many thanks!!!

    @carlorizzante great solution! Thanks!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘updated to 3.6 and now have a header error’ is closed to new replies.