Skip to content

Commit

Permalink
Revisions: Set PHP time limit when generating revision diffs vis Ajax.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@59288 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Oct 24, 2024
1 parent de38e8e commit 6bdf051
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-admin/includes/ajax-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 6bdf051

Please sign in to comment.