@@ 1550-1552 (lines=3) @@ | ||
1547 | return $suppress_errors ? false : new \WP_Error( 'no_token_for_user', sprintf( 'No token for user %d', $user_id ) ); |
|
1548 | } |
|
1549 | $user_token_chunks = explode( '.', $user_tokens[ $user_id ] ); |
|
1550 | if ( empty( $user_token_chunks[1] ) || empty( $user_token_chunks[2] ) ) { |
|
1551 | return $suppress_errors ? false : new \WP_Error( 'token_malformed', sprintf( 'Token for user %d is malformed', $user_id ) ); |
|
1552 | } |
|
1553 | if ( $user_token_chunks[2] !== (string) $user_id ) { |
|
1554 | return $suppress_errors ? false : new \WP_Error( 'user_id_mismatch', sprintf( 'Requesting user_id %d does not match token user_id %d', $user_id, $user_token_chunks[2] ) ); |
|
1555 | } |
|
@@ 1553-1555 (lines=3) @@ | ||
1550 | if ( empty( $user_token_chunks[1] ) || empty( $user_token_chunks[2] ) ) { |
|
1551 | return $suppress_errors ? false : new \WP_Error( 'token_malformed', sprintf( 'Token for user %d is malformed', $user_id ) ); |
|
1552 | } |
|
1553 | if ( $user_token_chunks[2] !== (string) $user_id ) { |
|
1554 | return $suppress_errors ? false : new \WP_Error( 'user_id_mismatch', sprintf( 'Requesting user_id %d does not match token user_id %d', $user_id, $user_token_chunks[2] ) ); |
|
1555 | } |
|
1556 | $possible_normal_tokens[] = "{$user_token_chunks[0]}.{$user_token_chunks[1]}"; |
|
1557 | } else { |
|
1558 | $stored_blog_token = \Jetpack_Options::get_option( 'blog_token' ); |