Skip to content

Commit

Permalink
Fix access denied loop when user not logged in
Browse files Browse the repository at this point in the history
Fixes #22740
  • Loading branch information
vboctor committed Apr 19, 2017
1 parent 3f7aa4b commit 90bab53
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/authentication_api.php
Expand Up @@ -83,6 +83,12 @@
*/
function auth_flags( $p_user_id = null, $p_username = '' ) {
if( is_null( $p_user_id ) ) {
# If user id is not provided and user is not authenticated return default flags.
# Otherwise, we can get into a loop as in #22740
if( !auth_is_user_authenticated() ) {
return new AuthFlags();
}

$t_user_id = auth_get_current_user_id();
} else {
$t_user_id = (int)$p_user_id;
Expand Down

0 comments on commit 90bab53

Please sign in to comment.