diff --git a/lib/eztemplate/classes/eztemplatecompiler.php b/lib/eztemplate/classes/eztemplatecompiler.php
index <HASH>..<HASH> 100644
--- a/lib/eztemplate/classes/eztemplatecompiler.php
+++ b/lib/eztemplate/classes/eztemplatecompiler.php
@@ -463,7 +463,8 @@ class eZTemplateCompiler
         // have enough time to compile
         // However if time limit is unlimited (0) we leave it be
         // Time limit will also be reset after subtemplates are compiled
-        if ( ini_get( 'max_execution_time' ) != 0  )
+        $maxExecutionTime = ini_get( 'max_execution_time' );
+        if ( $maxExecutionTime != 0 && $maxExecutionTime < 30 )
         {
             @set_time_limit( 30 );
         }
@@ -2288,7 +2289,8 @@ $rbracket
                                      * ensure that remaining template has
                                      * enough time to compile. However if time
                                      * limit is unlimited (0) we leave it be */
-                                    if ( ini_get( 'max_execution_time' ) != 0  )
+                                    $maxExecutionTime = ini_get( 'max_execution_time' );
+                                    if ( $maxExecutionTime != 0 && $maxExecutionTime < 60 )
                                     {
                                         @set_time_limit( 60 );
                                     }
eZTemplateCompiler:
- Make sure we only set the execution time if it's less then we want it to be.


git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>