From e6c5728b6cbe32eb2e8d71dfba47675ed344c071 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 3 Dec 2020 17:21:48 +0000 Subject: [PATCH] App Passwords: Return true when rate limiting a password's last used time. Previously we returned a `WP_Error` instance saying that the password was not found which is inaccurate. Props dlh. Reviewed by TimothyBlynJacobs, SergeyBiryukov. Merges [49739] to the 5.6 branch. Fixes #51922. git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49740 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-application-passwords.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-application-passwords.php b/src/wp-includes/class-wp-application-passwords.php index 4500a571d8..df8745ecba 100644 --- a/src/wp-includes/class-wp-application-passwords.php +++ b/src/wp-includes/class-wp-application-passwords.php @@ -203,7 +203,7 @@ class WP_Application_Passwords { // Only record activity once a day. if ( $password['last_used'] + DAY_IN_SECONDS > time() ) { - continue; + return true; } $password['last_used'] = time();