Skip to content

Commit

Permalink
Treat cached user id always as int
Browse files Browse the repository at this point in the history
Fixes #24931
  • Loading branch information
atrol committed Nov 12, 2018
1 parent ec29630 commit a5847f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/authentication_api.php
Expand Up @@ -72,7 +72,7 @@
$g_cache_cookie_valid = null;

# @global int $g_cache_current_user_id
$g_cache_current_user_id = null;
$g_cache_current_user_id = NO_USER;

/**
* Gets set of flags for authentication for the specified user.
Expand Down Expand Up @@ -1047,7 +1047,7 @@ function auth_is_cookie_valid( $p_cookie_string ) {
}

# succeeed if user has already been authenticated
if( null !== $g_cache_current_user_id ) {
if( NO_USER != $g_cache_current_user_id ) {
return true;
}

Expand Down Expand Up @@ -1077,7 +1077,7 @@ function auth_is_cookie_valid( $p_cookie_string ) {
function auth_get_current_user_id() {
global $g_cache_current_user_id;

if( null !== $g_cache_current_user_id ) {
if( NO_USER != $g_cache_current_user_id ) {
return (int)$g_cache_current_user_id;
}

Expand Down

0 comments on commit a5847f5

Please sign in to comment.