From 2410e392b930ec4d4173aaa07b6ecc4743cee41f Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 8 Apr 2012 01:06:44 +0000 Subject: [PATCH] wp_set_current_user(0) for XMLRPC_REQUEST in get_currentuserinfo(). Ensures that wp_get_current_user() always returns a WP_User object. see #20372. git-svn-id: http://svn.automattic.com/wordpress/trunk@20402 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 22f1c4813..e40d26ba4 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -74,8 +74,10 @@ if ( !function_exists('get_currentuserinfo') ) : function get_currentuserinfo() { global $current_user; - if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) + if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) { + wp_set_current_user(0); return false; + } if ( ! empty($current_user) ) return;