Active Directory Integration
wpdb::escape is deprecated since 3.6 (2 posts)

  1. C8H10N4O2
    Posted 2 years ago #


    I'm using your nice plugin with WordPress 3.6

    I get the following notice when using WordPress in debug mode.

    Notice: wpdb::escape est déprécié depuis la version 3.6! Utilisez wpdb::prepare() or esc_sql() à la place. in /var/www/webanalyse/wp-includes/functions.php on line 2871

    I searched for escape in the plugin files and the hits are :

    ad-integration.php (4 hits)
    Line 2390: $sql = "INSERT INTO $table_name (user_login, failed_login_time) VALUES ('" . $wpdb->escape($username)."'," . time() . ")";
    Line 2408: $sql = "SELECT count(*) AS count from $table_name WHERE user_login = '".$wpdb->escape($username)."' AND failed_login_time >= $time";
    Line 2429: $sql .= " OR user_login = '".$wpdb->escape($username)."'";
    Line 2447: $sql = "SELECT max(failed_login_time) FROM $table_name WHERE user_login = '".$wpdb->escape($username)."'";

    Note for other users : this does not seem to have any effect on functionality. If you see this warning, this means you're in debug mode, and you shouldn't if you're not actively developping your site.

    Thanks !


  2. jamesvandyke
    Posted 2 years ago #

    I replaced all of the $wpdb->escape($username) occurances with esc_sql($username) and it seemed to be ok.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Active Directory Integration
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic