Skip to content

Commit

Permalink
57512: Commit patch from 57512_with_tests_2.diff (adjusts comment for…
Browse files Browse the repository at this point in the history
…matting).
  • Loading branch information
kadamwhite committed Oct 9, 2023
1 parent 7c14968 commit 69c3446
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ function wp_populate_basic_auth_from_authorization_header() {
$token = substr( $header, 6 );
$userpass = base64_decode( $token );

list( $user, $pass ) = explode( ':', $userpass );
// There must be at least one colon in the string.
if ( ! str_contains( $userpass, ':' ) ) {
return;
}

list( $user, $pass ) = explode( ':', $userpass, 2 );

// Now shove them in the proper keys where we're expecting later on.
$_SERVER['PHP_AUTH_USER'] = $user;
Expand Down

0 comments on commit 69c3446

Please sign in to comment.