WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] updated to 3.6 and now have a header error (17 posts)

  1. DinaG
    Member
    Posted 11 months ago #

    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
    http://www.thatcreativefeeling.com

  2. Abhishek Ghosh
    Member
    Posted 11 months ago #

    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);

  3. Tara
    Member
    Posted 11 months ago #

    Also, have you reviewed this thread and attempted troubleshooting steps recommended therein: http://wordpress.org/support/topic/troubleshooting-wordpress-36-master-list

  4. DinaG
    Member
    Posted 11 months ago #

    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

  5. WPyogi
    Volunteer Moderator
    Posted 11 months ago #

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

    wp-content
        pluginsHOLD
  6. Tara
    Member
    Posted 11 months ago #

  7. DinaG
    Member
    Posted 11 months ago #

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

    thanks

  8. Carlo Rizzante
    Member
    Posted 11 months ago #

    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 WordPress.org 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? :)

  9. Carlo Rizzante
    Member
    Posted 11 months ago #

    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.

  10. kuif
    Member
    Posted 11 months ago #

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

  11. Wesam Alalem
    Member
    Posted 11 months ago #

    I confirm Carlo Rizzante solution, thank you.

  12. Sam Brodie
    Member
    Posted 11 months ago #

    @carlorizzante you're the man!

  13. Ivica Vujović
    Member
    Posted 11 months ago #

    @carlorizzante: Thank you very much for your solution.

  14. brasofilo
    Member
    Posted 11 months ago #

    Master stroke, @carlorizzante, master stroke!

    bravo, gazillion thanks :o)

  15. Clifford Paulick
    Member
    Posted 10 months ago #

    @carlorizzante saved the day!

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

    Many thanks!!!

  16. nicola.bonotto
    Member
    Posted 10 months ago #

    @carlorizzante great solution! Thanks!

  17. Clifford Paulick
    Member
    Posted 10 months ago #

    Turns out it's just for this plugin, not for all of WordPress, per WP Engine: http://wordpress.org/plugins/wordpress-mu-domain-mapping/

Reply

You must log in to post.

About this Topic