Make WordPress Core

Ticket #57512: 57512.diff

File 57512.diff, 602 bytes (added by shooper, 2 years ago)

Patch for PHP 8.0 support

  • src/wp-includes/load.php

    diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
    index 4c212086df..39ca2ff308 100644
    a b function wp_populate_basic_auth_from_authorization_header() { 
    122122        $token    = substr( $header, 6 );
    123123        $userpass = base64_decode( $token );
    124124
     125        // If there is no password provided, exit.
     126        if ( ! str_contains( $userpass, ':' ) ) {
     127                return;
     128        }
     129
     130        // Split token into $user and $pass variables
    125131        list( $user, $pass ) = explode( ':', $userpass );
    126132
    127133        // Now shove them in the proper keys where we're expecting later on.