Skip to content

Commit 2c59a6b

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix bug #80728: Don't reset the timeout on ini deactivate
2 parents d7afe6e + 65bd8d2 commit 2c59a6b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

main/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,15 @@ static PHP_INI_MH(OnUpdateTimeout)
407407
}
408408
zend_unset_timeout();
409409
ZEND_ATOL(EG(timeout_seconds), ZSTR_VAL(new_value));
410-
zend_set_timeout(EG(timeout_seconds), 0);
410+
if (stage != PHP_INI_STAGE_DEACTIVATE) {
411+
/*
412+
* If we're restoring INI values, we shouldn't reset the timer.
413+
* Otherwise, the timer is active when PHP is idle, such as the
414+
* the CLI web server or CGI. Running a script will re-activate
415+
* the timeout, so it's not needed to do so at script end.
416+
*/
417+
zend_set_timeout(EG(timeout_seconds), 0);
418+
}
411419
return SUCCESS;
412420
}
413421
/* }}} */

0 commit comments

Comments
 (0)