Fixed date calculation
authorAlexander Ebert <ebert@woltlab.com>
Fri, 9 Aug 2013 11:28:57 +0000 (13:28 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 9 Aug 2013 11:28:57 +0000 (13:28 +0200)
wcfsetup/install/files/lib/util/CronjobUtil.class.php

index 66a54c773015246e0e581cb656e51063016daa37..ee92eaeff478c868e0dee4e9fd9e8d49221d74f7 100644 (file)
@@ -164,8 +164,8 @@ final class CronjobUtil {
                $timeBase = self::$timeBase;
                
                if ($addAnDay) {
-                       $date = getdate($timeBase);
-                       $timeBase = gmmktime(0, 0, 1, $date['mon'], $date['mday'] + 1, $date['year']);
+                       $date = explode('.', gmdate("d.m.Y", $timeBase));
+                       $timeBase = gmmktime(0, 0, 1, $date[1], $date[0] + 1, $date[2]);
                }
                
                $day = gmdate('j', $timeBase);
@@ -305,10 +305,9 @@ final class CronjobUtil {
                        $index = self::findKey($hour, $values['hour'], false);
                        
                        if ($index === false) {
-                               if ($index === false) {
-                                       $index = self::findKey($hour, $values['hour']);
-                                       $addAnDay = true;
-                               }
+                               $index = self::findKey($hour, $values['hour']);
+                               $addAnDay = true;
+                               
                                $hour = $values['hour'][$index];
                        }
                }