Fixing deprecated errors
-
Here’s a diff you can apply to remove calls to deprecated functions.
@mvandemar are you able to make these changes to the plugin?
diff a/login-lockdown/loginlockdown.php b/login-lockdown/loginlockdown.php --- a/login-lockdown/loginlockdown.php +++ b/login-lockdown/loginlockdown.php @@ -165,9 +165,9 @@ function isLockedDown() { $ip = $_SERVER['REMOTE_ADDR']; $class_c = substr ($ip, 0 , strrpos ( $ip, "." )); - $stillLocked = $wpdb->get_var("SELECT user_id FROM $table_name " . + $stillLocked = $wpdb->get_var($wpdb->prepare("SELECT user_id FROM $table_name " . "WHERE release_date > now() AND " . - "lockdown_IP LIKE '" . $wpdb->escape($class_c) . "%'"); + "lockdown_IP LIKE %s", $class_c . '%')); return $stillLocked; } @@ -333,7 +333,7 @@ if ( isset($loginlockdown_db_version) ) { return $error; } - $userdata = get_userdatabylogin($username); + $userdata = get_user_by('login', $username); if ( !$userdata ) {
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Fixing deprecated errors’ is closed to new replies.