Przeglądaj źródła

fix warning in case of undefined date

stekkel 22 lat temu
rodzic
commit
9a7650588e
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      functions/date.php

+ 3 - 0
functions/date.php

@@ -261,6 +261,9 @@ function getTimeStamp($dateParts) {
      * array is an integer or not.
      * Since the day of week is optional, this check is needed.
      */
+     if (count($dateParts) <2) {
+        return 0;
+     }
 
     /* remove day of week */
     if (!is_numeric(trim($dateParts[0]))) {