Skip to content

Commit

Permalink
Upgrade/Install: Silence Requests deprecations before preloading.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SergeyBiryukov committed Feb 5, 2023
1 parent 81f31d6 commit ec83fd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down

0 comments on commit ec83fd8

Please sign in to comment.