HTTP API: Update `WP_Http` class to avoid PHP deprecation warnings.

This changeset prevents a PHP 8.3 deprecation shown when enabling debug and calling `get_class()` without arguments.

For more info about this deprecation, see https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#get_class_and_get_parent_class.

Props ipajen, rajinsharwar, SergeyBiryukov, jrf.
Fixes #58876.




Built from https://develop.svn.wordpress.org/trunk@56495


git-svn-id: http://core.svn.wordpress.org/trunk@56007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-08-30 22:09:17 +00:00
parent b5789d72c3
commit 42648581c7
2 changed files with 3 additions and 3 deletions

View File

@ -326,11 +326,11 @@ class WP_Http {
); );
// Ensure redirects follow browser behavior. // Ensure redirects follow browser behavior.
$options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) ); $options['hooks']->register( 'requests.before_redirect', array( static::class, 'browser_redirect_compatibility' ) );
// Validate redirected URLs. // Validate redirected URLs.
if ( function_exists( 'wp_kses_bad_protocol' ) && $parsed_args['reject_unsafe_urls'] ) { if ( function_exists( 'wp_kses_bad_protocol' ) && $parsed_args['reject_unsafe_urls'] ) {
$options['hooks']->register( 'requests.before_redirect', array( get_class(), 'validate_redirects' ) ); $options['hooks']->register( 'requests.before_redirect', array( static::class, 'validate_redirects' ) );
} }
if ( $parsed_args['stream'] ) { if ( $parsed_args['stream'] ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56494'; $wp_version = '6.4-alpha-56495';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.