Ver código fonte

fix warning in case of undefined date

stekkel 22 anos atrás
pai
commit
9a7650588e
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      functions/date.php

+ 3 - 0
functions/date.php

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