Skip to content

Commit 161b675

Browse files
committed
Merge pull request WP-API#63 from BuzzMyVideosDev/feature/issue-62-hash-equals-ints
Fix issue WP-API#62, ensure values to hash_equals are strings
2 parents 90919b5 + 72dd5a1 commit 161b675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/class-wp-json-authentication-oauth1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function check_token( $token, $consumer_key ) {
316316
return $consumer;
317317
}
318318

319-
if ( ! hash_equals( $token['consumer'], $consumer->ID ) ) {
319+
if ( ! hash_equals( (string) $token['consumer'], (string) $consumer->ID ) ) {
320320
return new WP_Error( 'json_oauth1_consumer_mismatch', __( 'Token is not registered for the given consumer' ), array( 'status' => 401 ) );
321321
}
322322

0 commit comments

Comments
 (0)