diff --git a/public/class-jwt-auth-public.php b/public/class-jwt-auth-public.php index 430ecaa..68e6df5 100644 --- a/public/class-jwt-auth-public.php +++ b/public/class-jwt-auth-public.php @@ -219,10 +219,10 @@ public function determine_current_user( $user ) { /** * We still need to get the Authorization header and check for the token. */ - $auth_header = $_SERVER['HTTP_AUTHORIZATION'] ? sanitize_text_field( $_SERVER['HTTP_AUTHORIZATION'] ) : false; + $auth_header = ! empty( $_SERVER['HTTP_AUTHORIZATION'] ) ? sanitize_text_field( $_SERVER['HTTP_AUTHORIZATION'] ) : false; /* Double check for different auth header string (server dependent) */ if ( ! $auth_header ) { - $auth_header = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] ? sanitize_text_field( $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] ) : false; + $auth_header = ! empty( $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] ) ? sanitize_text_field( $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] ) : false; } if ( ! $auth_header ) {