<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
+ {elseif $errorType == 'invalid'}
+ {lang latestDate=TIME_NOW|plainTime}wcf.form.field.date.error.latestDate{/lang}
{else}
{lang}wcf.acp.article.time.error.{@$errorType}{/lang}
{/if}
<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
+ {elseif $errorType == 'invalid'}
+ {lang latestDate=TIME_NOW|plainTime}wcf.form.field.date.error.latestDate{/lang}
{else}
{lang}wcf.acp.article.time.error.{@$errorType}{/lang}
{/if}
if (empty($this->time) || !$this->timeObj) {
throw new UserInputException('time');
}
+ if ($this->timeObj->getTimestamp() > TIME_NOW && $this->publicationStatus == Article::PUBLISHED) {
+ throw new UserInputException('time', 'invalid');
+ }
// publication status
if ($this->publicationStatus != Article::UNPUBLISHED && $this->publicationStatus != Article::PUBLISHED && $this->publicationStatus != Article::DELAYED_PUBLICATION) {
}
$data = [
- 'time' => $this->getArticleTimestamp(),
+ 'time' => $this->timeObj->getTimestamp(),
'categoryID' => $this->categoryID,
'publicationStatus' => $this->publicationStatus,
'publicationDate' => $this->publicationStatus == Article::DELAYED_PUBLICATION ? $this->publicationDateObj->getTimestamp() : 0,
'labelGroupsToCategories' => $this->labelGroupsToCategories,
]);
}
-
- /**
- * Ensures that the date of a published article is not in the future.
- *
- * @since 5.5
- */
- protected function getArticleTimestamp(): int
- {
- $time = $this->timeObj->getTimestamp();
- if ($time > \TIME_NOW && $this->publicationStatus == Article::PUBLISHED) {
- $time = \TIME_NOW;
- }
-
- return $time;
- }
}
'enableComments' => $this->enableComments,
'userID' => $this->author->userID,
'username' => $this->author->username,
- 'time' => $this->getArticleTimestamp(),
+ 'time' => $this->timeObj->getTimestamp(),
'hasLabels' => (isset($labelIDs[$this->article->articleID]) && !empty($labelIDs[$this->article->articleID])) ? 1 : 0,
];