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. Built from https://develop.svn.wordpress.org/trunk@55258 git-svn-id: http://core.svn.wordpress.org/trunk@54791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
804fbe781a
commit
b29536b060
|
@ -3528,7 +3528,10 @@ function wp_ajax_get_revision_diffs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
set_time_limit( 0 );
|
|
||||||
|
if ( function_exists( 'set_time_limit' ) ) {
|
||||||
|
set_time_limit( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( $_REQUEST['compare'] as $compare_key ) {
|
foreach ( $_REQUEST['compare'] as $compare_key ) {
|
||||||
list( $compare_from, $compare_to ) = explode( ':', $compare_key ); // from:to
|
list( $compare_from, $compare_to ) = explode( ':', $compare_key ); // from:to
|
||||||
|
|
|
@ -471,7 +471,9 @@ class WP_Upgrader {
|
||||||
$destination = $args['destination'];
|
$destination = $args['destination'];
|
||||||
$clear_destination = $args['clear_destination'];
|
$clear_destination = $args['clear_destination'];
|
||||||
|
|
||||||
set_time_limit( 300 );
|
if ( function_exists( 'set_time_limit' ) ) {
|
||||||
|
set_time_limit( 300 );
|
||||||
|
}
|
||||||
|
|
||||||
if ( empty( $source ) || empty( $destination ) ) {
|
if ( empty( $source ) || empty( $destination ) ) {
|
||||||
return new WP_Error( 'bad_request', $this->strings['bad_request'] );
|
return new WP_Error( 'bad_request', $this->strings['bad_request'] );
|
||||||
|
|
|
@ -540,7 +540,9 @@ function wp_edit_theme_plugin_file( $args ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure PHP process doesn't die before loopback requests complete.
|
// Make sure PHP process doesn't die before loopback requests complete.
|
||||||
set_time_limit( 5 * MINUTE_IN_SECONDS );
|
if ( function_exists( 'set_time_limit' ) ) {
|
||||||
|
set_time_limit( 5 * MINUTE_IN_SECONDS );
|
||||||
|
}
|
||||||
|
|
||||||
// Time to wait for loopback requests to finish.
|
// Time to wait for loopback requests to finish.
|
||||||
$timeout = 100; // 100 seconds.
|
$timeout = 100; // 100 seconds.
|
||||||
|
|
|
@ -1053,7 +1053,9 @@ $_new_bundled_files = array(
|
||||||
function update_core( $from, $to ) {
|
function update_core( $from, $to ) {
|
||||||
global $wp_filesystem, $_old_files, $_old_requests_files, $_new_bundled_files, $wpdb;
|
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`.
|
* Merge the old Requests files and directories into the `$_old_files`.
|
||||||
|
|
|
@ -3111,7 +3111,10 @@ function pingback( $content, $post ) {
|
||||||
$pingback_server_url = discover_pingback_server_uri( $pagelinkedto );
|
$pingback_server_url = discover_pingback_server_uri( $pagelinkedto );
|
||||||
|
|
||||||
if ( $pingback_server_url ) {
|
if ( $pingback_server_url ) {
|
||||||
set_time_limit( 60 );
|
if ( function_exists( 'set_time_limit' ) ) {
|
||||||
|
set_time_limit( 60 );
|
||||||
|
}
|
||||||
|
|
||||||
// Now, the RPC call.
|
// Now, the RPC call.
|
||||||
$pagelinkedfrom = get_permalink( $post );
|
$pagelinkedfrom = get_permalink( $post );
|
||||||
|
|
||||||
|
|
|
@ -3659,7 +3659,9 @@ function post_permalink( $post = 0 ) {
|
||||||
function wp_get_http( $url, $file_path = false, $red = 1 ) {
|
function wp_get_http( $url, $file_path = false, $red = 1 ) {
|
||||||
_deprecated_function( __FUNCTION__, '4.4.0', 'WP_Http' );
|
_deprecated_function( __FUNCTION__, '4.4.0', 'WP_Http' );
|
||||||
|
|
||||||
@set_time_limit( 60 );
|
if ( function_exists( 'set_time_limit' ) ) {
|
||||||
|
@set_time_limit( 60 );
|
||||||
|
}
|
||||||
|
|
||||||
if ( $red > 5 )
|
if ( $red > 5 )
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.2-alpha-55257';
|
$wp_version = '6.2-alpha-55258';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue