diff --git a/core/includes/common.inc b/core/includes/common.inc
index f2a2b4c..924d5ec 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1220,7 +1220,11 @@ function l($text, $path, array $options = array()) {
  */
 function drupal_set_time_limit($time_limit) {
   if (function_exists('set_time_limit')) {
-    @set_time_limit($time_limit);
+    $current = ini_get('max_execution_time');
+    // Only allow increasing the time limit.
+    if ($current < $time_limit && $current !== 0) {
+      @set_time_limit($time_limit);
+    }
   }
 }
 
