From 86661dc523c834fcc82cbf830070fee9a0c58623 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 29 Jul 2013 03:43:22 +0000 Subject: [PATCH] Don't override an existing WP_Error object in wp_authenticate_username_password(). props willnorris. fixes #19714. git-svn-id: https://develop.svn.wordpress.org/trunk@24850 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/user.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/user.php b/wp-includes/user.php index 718ae19bf4..be11b736da 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -73,6 +73,9 @@ function wp_authenticate_username_password($user, $username, $password) { if ( is_a($user, 'WP_User') ) { return $user; } if ( empty($username) || empty($password) ) { + if ( is_wp_error( $user ) ) + return $user; + $error = new WP_Error(); if ( empty($username) )