@@ 376-379 (lines=4) @@ | ||
373 | return $suppress_errors ? false : new WP_Error( 'no_token_for_user', sprintf( __( 'No token for user %d', 'jetpack' ), $user_id ) ); |
|
374 | } |
|
375 | $user_token_chunks = explode( '.', $user_tokens[ $user_id ] ); |
|
376 | if ( empty( $user_token_chunks[1] ) || empty( $user_token_chunks[2] ) ) { |
|
377 | // translators: %s is the user ID. |
|
378 | return $suppress_errors ? false : new WP_Error( 'token_malformed', sprintf( __( 'Token for user %d is malformed', 'jetpack' ), $user_id ) ); |
|
379 | } |
|
380 | if ( $user_token_chunks[2] !== (string) $user_id ) { |
|
381 | // translators: %1$d is the ID of the requested user. %2$d is the user ID found in the token. |
|
382 | return $suppress_errors ? false : new WP_Error( 'user_id_mismatch', sprintf( __( 'Requesting user_id %1$d does not match token user_id %2$d', 'jetpack' ), $user_id, $user_token_chunks[2] ) ); |
@@ 1744-1745 (lines=2) @@ | ||
1741 | // Try to log in with the username and password. |
|
1742 | } |
|
1743 | $retval = $user; |
|
1744 | if ( empty( $_POST['_vptrue'] ) || !in_array( $_POST['_vptrue'], $this->get_login_tokens(), true ) ) |
|
1745 | $retval = new WP_Error( 'invalid_token', __( 'Invalid token. Please try to log in again.' ) ); |
|
1746 | ||
1747 | return $retval; |
|
1748 | } |