Merge pull request #4273 from stevie-mayhew/pulls/increase_time_limit

FIX: increase_time_limit_to work when increase_time_limit_max is not yet set
This commit is contained in:
Daniel Hensby 2015-06-22 21:33:00 +01:00
commit 7cd5cf3d4a

View File

@ -27,6 +27,9 @@ error_reporting(E_ALL | E_STRICT);
*/ */
require_once dirname(__FILE__).'/Constants.php'; require_once dirname(__FILE__).'/Constants.php';
global $_increase_time_limit_max;
$_increase_time_limit_max = -1;
/** /**
* Priorities definition. These constants are used in calls to _t() as an optional argument * Priorities definition. These constants are used in calls to _t() as an optional argument
*/ */
@ -255,7 +258,7 @@ function translate_memstring($memString) {
*/ */
function increase_time_limit_to($timeLimit = null) { function increase_time_limit_to($timeLimit = null) {
$max = get_increase_time_limit_max(); $max = get_increase_time_limit_max();
if($max != -1 && $timeLimit > $max) return false; if($max != -1 && $max != null && $timeLimit > $max) return false;
if(!ini_get('safe_mode')) { if(!ini_get('safe_mode')) {
if(!$timeLimit) { if(!$timeLimit) {
@ -274,8 +277,6 @@ function increase_time_limit_to($timeLimit = null) {
} }
} }
$_increase_time_limit_max = -1;
/** /**
* Set the maximum allowed value for {@link increase_timeLimit_to()}; * Set the maximum allowed value for {@link increase_timeLimit_to()};
* *