Browse Source

Cast and raise time limit.

dereuromark 9 years ago
parent
commit
53b59ba89b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Model/Behavior/ResetBehavior.php

+ 2 - 2
Model/Behavior/ResetBehavior.php

@@ -103,9 +103,9 @@ class ResetBehavior extends ModelBehavior {
 
 		$params += $defaults;
 		$count = $Model->find('count', compact('conditions'));
-		$max = ini_get('max_execution_time');
+		$max = (int)ini_get('max_execution_time');
 		if ($max) {
-			set_time_limit(max($max, $count / $limit));
+			set_time_limit(max($max, $count));
 		}
 
 		$modified = 0;