From ec83fd83fbb01ebbbff87fb0a7e6c05cd24b0374 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 5 Feb 2023 00:18:35 +0000 Subject: [PATCH] Upgrade/Install: Silence Requests deprecations before preloading. Intentional preloading of Requests 2.x classes and interfaces using their old (Requests 1.x) names should not produce deprecation notices. This commit defines `REQUESTS_SILENCE_PSR0_DEPRECATIONS` as `true` in `_preload_old_requests_classes_and_interfaces()`. Follow-up to [54997], [55007], [55046]. Props costdev, afragen, jrf. Fixes #54504. git-svn-id: https://develop.svn.wordpress.org/trunk@55225 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/update-core.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index a17c03359a202..005d70cbf610c 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1599,6 +1599,10 @@ function update_core( $from, $to ) { function _preload_old_requests_classes_and_interfaces( $to ) { global $_old_requests_files, $wp_filesystem; + if ( ! defined( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS' ) ) { + define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true ); + } + foreach ( $_old_requests_files as $name => $file ) { // Skip files that aren't interfaces or classes. if ( is_int( $name ) ) {