Skip to content

Commit 17bc9c6

Browse files
committed
Simplify/rename variables
1 parent 45f28b8 commit 17bc9c6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function parse_header( $header ) {
6060

6161
}
6262

63-
public function retrieve_authorization_headers() {
63+
public function get_authorization_header() {
6464
if ( ! empty( $_SERVER['HTTP_AUTHORIZATION'] ) ) {
6565
return wp_unslash( $_SERVER['HTTP_AUTHORIZATION'] );
6666
}
@@ -83,15 +83,15 @@ public function get_parameters( $require_token = true, $extra = array() ) {
8383
$params = array_merge( $_GET, $_POST );
8484
$params = wp_unslash( $params );
8585

86-
$auth_headers = $this->retrieve_authorization_headers();
86+
$header = $this->get_authorization_header();
8787

88-
if ( ! empty( $auth_headers ) ) {
88+
if ( ! empty( $header ) ) {
8989
// Trim leading spaces
90-
$auth_headers = trim( $auth_headers );
90+
$header = trim( $header );
9191

92-
$auth_header_params = $this->parse_header( $auth_headers );
93-
if ( ! empty( $auth_header_params ) ) {
94-
$params = array_merge( $params, $auth_header_params );
92+
$header_params = $this->parse_header( $header );
93+
if ( ! empty( $header_params ) ) {
94+
$params = array_merge( $params, $header_params );
9595
}
9696
}
9797

0 commit comments

Comments
 (0)