• My WP has define('WP_DEBUG', true). Updating WP to version 3.6 caused a NOTICE due to wpdb::escape being deprecated. According to http://goo.gl/06dSwlwpdb::escape() performs weak escaping and esc_sql() was updated to do ‘real’ escaping”. I found occurrences of $wpdb->escape in secure.php and process.php . Is it safe for me to perform a search and replace changing $wpdb->escape to esc_sql() or $wpdb->prepare ?

    In addition: Today I just updated WP to version 3.6 and problems emerged. I believe some of them were caused by better-wp-security. I had to set define('WP_DEBUG', false) in order to complete the update.

    http://wordpress.org/plugins/better-wp-security/

Viewing 5 replies - 1 through 5 (of 5 total)
  • same here.

    This error is also triggered by the Broken Link Checker plugin …

    Confirming aluizioll‘s suspicions: the notice seems to be triggered by Better WP Security. Anyone found word from the developer as to a fix?

    Deactivated all plugins and found Better WP Security the source of the wpdb::escape notice. Running 3.6.

    Miguel

    (@teledirigido)

    Same here, I fixed replacing:

    $type = $wpdb->escape( $type );

    into

    $type = esc_sql( $type );

    Source:
    https://www.webniraj.com/2013/08/05/wordpress-3-6-fixing-wpdbescape-deprecation-errors/

    But as you said, not sure if is super safe.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘$wpdb->escape causing a NOTICE’ is closed to new replies.