Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
57512: Commit patch from 57512_with_tests_2.diff (adjusts comment for…
…matting).
  • Loading branch information
kadamwhite committed Oct 9, 2023
commit 69c34467f5995105249b3945496f4b587c0696aa
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