Treat invalid timestamps as a missing date
authorAlexander Ebert <ebert@woltlab.com>
Sat, 8 Jan 2022 16:39:30 +0000 (17:39 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 8 Jan 2022 16:39:30 +0000 (17:39 +0100)
wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php

index 74a632e697fc0db639426f423efea4a099260c89..cba609b822a669d69439b9d429ad6ca26c2ffd68 100644 (file)
@@ -372,12 +372,9 @@ class ArticleAddForm extends AbstractForm
         }
 
         // article date
-        if (empty($this->time)) {
+        if (empty($this->time) || !$this->timeObj) {
             throw new UserInputException('time');
         }
-        if (!$this->timeObj) {
-            throw new UserInputException('time', 'invalid');
-        }
 
         // publication status
         if ($this->publicationStatus != Article::UNPUBLISHED && $this->publicationStatus != Article::PUBLISHED && $this->publicationStatus != Article::DELAYED_PUBLICATION) {