-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadvagg_max_execution_time.patch
32 lines (31 loc) · 1.14 KB
/
advagg_max_execution_time.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/advagg_css_compress/yui/CSSMin.inc b/advagg_css_compress/yui/CSSMin.inc
index eb98750..22b78fa 100644
--- a/advagg_css_compress/yui/CSSMin.inc
+++ b/advagg_css_compress/yui/CSSMin.inc
@@ -213,11 +213,23 @@ class CSSmin
// If current settings are higher respect them.
foreach ($php_limits as $name => $suggested) {
- $current = $this->normalize_int(ini_get($name));
- // memory_limit exception: allow -1 for "no memory limit".
- if ($current > -1 && ($suggested == -1 || $current < $suggested)) {
- ini_set($name, $suggested);
- }
+ $current = $this->normalize_int(ini_get($name));
+
+ if ($current > $suggested) {
+ continue;
+ }
+
+ // memoryLimit exception: allow -1 for "no memory limit".
+ if ($name === 'memory_limit' && $current === -1) {
+ continue;
+ }
+
+ // maxExecutionTime exception: allow 0 for "no memory limit".
+ if ($name === 'max_execution_time' && $current === 0) {
+ continue;
+ }
+
+ ini_set($name, $suggested);
}
}