From 65ef0dcbb9a0e329985c74b320986791c7b9d0a4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 3 Dec 2020 17:23:05 +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. Built from https://develop.svn.wordpress.org/branches/5.6@49740 git-svn-id: http://core.svn.wordpress.org/branches/5.6@49463 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-application-passwords.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-application-passwords.php b/wp-includes/class-wp-application-passwords.php index 4500a571d8..df8745ecba 100644 --- a/wp-includes/class-wp-application-passwords.php +++ b/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(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 9352bc212c..a44d879497 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-RC2-49738'; +$wp_version = '5.6-RC2-49740'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.