diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index ac305ada4a..170746370a 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1595,11 +1595,22 @@ function update_core( $from, $to ) { * * @global array $_old_requests_files Requests files to be preloaded. * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. + * @global string $wp_version The WordPress version string. * * @param string $to Path to old WordPress installation. */ function _preload_old_requests_classes_and_interfaces( $to ) { - global $_old_requests_files, $wp_filesystem; + global $_old_requests_files, $wp_filesystem, $wp_version; + + /* + * Requests was introduced in WordPress 4.6. + * + * Skip preloading if the website was previously using + * an earlier version of WordPress. + */ + if ( version_compare( $wp_version, '4.6', '<' ) ) { + return; + } if ( ! defined( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS' ) ) { define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true );