diff --git a/src/Core/Command/PostReplyHandler.php b/src/Core/Command/PostReplyHandler.php index 937568a9a..ca62b2859 100644 --- a/src/Core/Command/PostReplyHandler.php +++ b/src/Core/Command/PostReplyHandler.php @@ -10,6 +10,7 @@ namespace Flarum\Core\Command; +use DateTime; use Flarum\Core\Access\AssertPermissionTrait; use Flarum\Core\Validator\PostValidator; use Flarum\Event\PostWillBeSaved; @@ -85,6 +86,10 @@ class PostReplyHandler $command->ipAddress ); + if ($actor->isAdmin() && ($time = array_get($command->data, 'attributes.time'))) { + $post->time = new DateTime($time); + } + $this->events->fire( new PostWillBeSaved($post, $actor, $command->data) );