Skip to content

Commit

Permalink
Fix REST API cookie auth for users with 32 char cookies
Browse files Browse the repository at this point in the history
Fixes #23954
  • Loading branch information
vboctor committed Feb 9, 2018
1 parent 992c478 commit 29c4074
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
5 changes: 0 additions & 5 deletions core/authentication_api.php
Expand Up @@ -1113,11 +1113,6 @@ function auth_get_current_user_id() {
* @access public
*/
function auth_user_id_from_cookie( $p_cookie_string ) {
# Save a db query if value provided doesn't look like a cookie
if( strlen( $p_cookie_string ) != AUTH_COOKIE_LENGTH ) {
return false;
}

if( $t_result = user_search_cache( 'cookie_string', $p_cookie_string ) ) {
$t_user_id = (int)$t_result['id'];
return $t_user_id;
Expand Down
1 change: 0 additions & 1 deletion core/constant_inc.php
Expand Up @@ -612,7 +612,6 @@
define( 'LINKS_NEW_WINDOW', 2 );

# Auth Related Constants
define( 'AUTH_COOKIE_LENGTH', 64 );
define( 'API_TOKEN_LENGTH', 32 );

# Obsolete / deprecated constants
Expand Down

0 comments on commit 29c4074

Please sign in to comment.