Skip to content

Commit

Permalink
Fix intermittent "error 2300 token not found"
Browse files Browse the repository at this point in the history
In some rare cases, collapse_cache_token() would attempt to touch a
token that does not exist. This can happen when the current user does
not have any TOKEN_COLLAPSE token, and the MANTIS_collapse_cookie
contains a non-empty value that does not form a valid, colon-delimited
pair.

The issue has been addressed by adding a token_exists() check prior to
calling token_touch().

Fixes #21068
  • Loading branch information
dregad committed Jun 12, 2016
1 parent 51f2c78 commit bd5a685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/collapse_api.php
Expand Up @@ -224,7 +224,7 @@ function collapse_cache_token() {
if( $t_update ) {
$t_value = json_encode( $g_collapse_cache_token );
token_set( TOKEN_COLLAPSE, $t_value, TOKEN_EXPIRY_COLLAPSE );
} else {
} elseif( token_exists( $t_token['id'] ) ) {
token_touch( $t_token['id'] );
}

Expand Down

0 comments on commit bd5a685

Please sign in to comment.