Skip to content

Commit 6b7cbe0

Browse files
committed
Merge pull request #10 from WP-API/trim-correctly
Trim header correctly
2 parents 55f641f + 663f6cf commit 6b7cbe0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public function get_parameters( $require_token = true, $extra = array() ) {
6767
if ( ! empty( $_SERVER['HTTP_AUTHORIZATION'] ) ) {
6868
$header = wp_unslash( $_SERVER['HTTP_AUTHORIZATION'] );
6969

70-
// Trim leading 'Authorization:'
71-
$header = trim( substr( $header, 14 ) );
70+
// Trim leading spaces
71+
$header = trim( $header );
7272

7373
$header_params = $this->parse_header( $header );
7474
if ( ! empty( $header_params ) ) {

0 commit comments

Comments
 (0)