From 11dfb2d16266d833eaa51c004d6e9eaca6ed27e3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 25 Oct 2024 00:00:20 +0000 Subject: [PATCH] Revisions: Set PHP time limit when generating revision diffs vis Ajax. This aims to avoid hanging PHP processes if a plugin inadvertently attempts to request a large number of revision diffs. Follow-up to [24520], [24707], [59039]. Props madpeter, lovesoni1999, debarghyabanerjee, pbearne, desrosj, SergeyBiryukov. Fixes #49291. Built from https://develop.svn.wordpress.org/trunk@59288 git-svn-id: http://core.svn.wordpress.org/trunk@58680 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 75d7a61000..27ec0d8752 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -3556,9 +3556,9 @@ function wp_ajax_get_revision_diffs() { $return = array(); - // Removes the script timeout limit by setting it to 0 allowing ample time for diff UI setup. if ( function_exists( 'set_time_limit' ) ) { - set_time_limit( 0 ); + // Increase the script timeout limit to allow ample time for diff UI setup. + set_time_limit( 5 * MINUTE_IN_SECONDS ); } foreach ( $_REQUEST['compare'] as $compare_key ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 269c6d73a4..ceb44bfc48 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59287'; +$wp_version = '6.8-alpha-59288'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.