I18N: In get_user_locale() ensure that $user_id isn't a falsy value before calling get_user_by().

Fixes #38485.

git-svn-id: https://develop.svn.wordpress.org/trunk@39134 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2016-11-03 23:05:34 +00:00
parent ed37aaa664
commit ece3b68aaf

View File

@ -92,7 +92,7 @@ function get_user_locale( $user_id = 0 ) {
$user = wp_get_current_user();
} elseif ( $user_id instanceof WP_User ) {
$user = $user_id;
} elseif ( is_numeric( $user_id ) ) {
} elseif ( $user_id && is_numeric( $user_id ) ) {
$user = get_user_by( 'id', $user_id );
}