mirror of
git://develop.git.wordpress.org/
synced 2025-02-06 23:50:43 +01:00
Upgrade/Install: Skip preloading Requests for WordPress versions before 4.6.
Skip preloading Requests files in `_preload_old_requests_classes_and_interfaces()` when updating from a WordPress version older than 4.6. Why? Requests library was first introduced into WordPress 4.6 via #33055 / [37428]. If a user is upgrading from a version older than 4.6, this changeset prevents the Requests preloading to prevent a fatal error of attempting to load files that do not exist in their current WordPress version. Follow-up to [54997], [37428]. Props afragen, costdev, ironprogrammer, antonvlasenko. Fixes #57662. git-svn-id: https://develop.svn.wordpress.org/trunk@55296 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fe119088ec
commit
868e43d471
@ -1595,11 +1595,22 @@ function update_core( $from, $to ) {
|
|||||||
*
|
*
|
||||||
* @global array $_old_requests_files Requests files to be preloaded.
|
* @global array $_old_requests_files Requests files to be preloaded.
|
||||||
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
* @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.
|
* @param string $to Path to old WordPress installation.
|
||||||
*/
|
*/
|
||||||
function _preload_old_requests_classes_and_interfaces( $to ) {
|
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' ) ) {
|
if ( ! defined( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS' ) ) {
|
||||||
define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true );
|
define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user