General: Check that set_time_limit() function is available before using it in core.

This avoids a fatal error if the function is disabled on certain environments.

Props theode, jokerrs, johnbillion, hellofromTonya, costdev, jrf, azaozz, SergeyBiryukov.
Fixes #55711.

git-svn-id: https://develop.svn.wordpress.org/trunk@55258 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-02-07 13:26:46 +00:00
parent 4a2d96ee6b
commit b60ccbdb26
6 changed files with 20 additions and 6 deletions

View File

@@ -1053,7 +1053,9 @@ $_new_bundled_files = array(
function update_core( $from, $to ) {
global $wp_filesystem, $_old_files, $_old_requests_files, $_new_bundled_files, $wpdb;
set_time_limit( 300 );
if ( function_exists( 'set_time_limit' ) ) {
set_time_limit( 300 );
}
/*
* Merge the old Requests files and directories into the `$_old_files`.