Return immediately if we don't have start and end dates.
authorJan Schneider <jan@horde.org>
Thu, 26 Feb 2009 23:14:56 +0000 (00:14 +0100)
committerJan Schneider <jan@horde.org>
Thu, 26 Feb 2009 23:14:56 +0000 (00:14 +0100)
kronolith/lib/Driver/Holidays.php

index 6c7769d..d5bbb15 100644 (file)
@@ -42,13 +42,10 @@ class Kronolith_Driver_Holidays extends Kronolith_Driver
                               __FILE__, __LINE__, PEAR_LOG_ERR);
             return array();
         }
-
-        if (is_null($startDate)) {
-            $startDate = new Horde_Date($_SERVER['REQUEST_TIME']);
-        }
-        if (is_null($endDate)) {
-            $endDate = new Horde_Date($_SERVER['REQUEST_TIME']);
+        if ($hasAlarm || is_null($startDate) || is_null($endDate)) {
+            return array();
         }
+
         Date_Holidays::staticSetProperty('DIE_ON_MISSING_LOCALE', false);
 
         $events = array();