fixed dow & month
authorderpierre65 <admin@derpierre65.de>
Tue, 28 Nov 2017 14:47:04 +0000 (15:47 +0100)
committerGitHub <noreply@github.com>
Tue, 28 Nov 2017 14:47:04 +0000 (15:47 +0100)
I think that is the desired effect?

wcfsetup/install/files/lib/util/CronjobUtil.class.php

index 5089c82df39c9cca3e9f84d1dfb48d03b6f0bcdb..b23c042b5a78f3b1c3cbdc33dca08493091b36bf 100644 (file)
@@ -109,8 +109,8 @@ final class CronjobUtil {
                        
                        switch ($fieldName) {
                                case 'dow':
-                                       if (strlen($fieldValue) == 3 && in_array($fieldName, $dayNames)) {
-                                               $fieldValue = $dayNames[$fieldValue];
+                                       if (strlen($fieldValue) == 3 && in_array($fieldValue, $dayNames)) {
+                                               $fieldValue = array_search($fieldValue, $dayNames);
                                        }
                                        // When specifying day of week, both day 0 and day 7
                                        // will be considered Sunday. -- crontab(5) 
@@ -121,7 +121,7 @@ final class CronjobUtil {
                                
                                case 'month':
                                        if (strlen($fieldValue) == 3 && in_array($fieldValue, $monthNames)) {
-                                               $fieldValue = $monthNames[$fieldValue] + 1;
+                                               $fieldValue = array_search($fieldValue, $monthNames) + 1;
                                        }
                                break;
                        }