mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-24 09:11:24 +01:00
Harden up is_user_logged_in() against empty $current_user instances to prevent PHP Notices on XML-RPC requests. Fixes #18458
git-svn-id: http://svn.automattic.com/wordpress/trunk@18558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7140ac9bf4
commit
6fa755e68e
@ -755,7 +755,7 @@ if ( !function_exists('is_user_logged_in') ) :
|
|||||||
function is_user_logged_in() {
|
function is_user_logged_in() {
|
||||||
$user = wp_get_current_user();
|
$user = wp_get_current_user();
|
||||||
|
|
||||||
if ( $user->ID == 0 )
|
if ( empty( $user->ID ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user