From 98284ae792d95d4484c25b11d6f4fea4f6603cbc Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Wed, 30 Aug 2023 22:07:13 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@56495 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-http.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-http.php b/src/wp-includes/class-wp-http.php index e1d37878a1..546ba96c1c 100644 --- a/src/wp-includes/class-wp-http.php +++ b/src/wp-includes/class-wp-http.php @@ -326,11 +326,11 @@ class WP_Http { ); // 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. 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'] ) {