Skip to content

Commit 3a7a2a2

Browse files
committed
Better to use array_key_exists
1 parent b60938f commit 3a7a2a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public function retrieve_authorization_headers() {
6565

6666
if ( ! $auth_headers && function_exists( 'apache_request_headers' ) ) {
6767
$all_headers = apache_request_headers();
68-
$auth_headers = isset( $all_headers['Authorization'] ) ? $all_headers['Authorization'] : false;
68+
69+
$auth_headers = array_key_exists( 'Authorization', $all_headers ) ? $all_headers['Authorization'] : false;
6970
}
7071

7172
return $auth_headers;

0 commit comments

Comments
 (0)