/** * @see Action::execute() */ public function execute() { parent::execute(); // add edit note $postData = array(); if (!$this->board->getPermission('canHideEditNote') && (WCF::getUser()->userID != $this->post->userID || $this->post->time <= TIME_NOW - POST_EDIT_HIDE_EDIT_NOTE_PERIOD * 60)) { $postData['editor'] = WCF::getUser()->username; $postData['editorID'] = WCF::getUser()->userID; $postData['lastEditTime'] = TIME_NOW; $postData['editCount'] = $this->post->editCount + 1; $postData['editReason'] = ''; } // update message $this->post->updateMessage($this->text, $postData); if ($this->thread->firstPostID == $this->post->postID) { // update first post preview $this->post->updateFirstPostPreview($this->post->threadID, $this->post->postID, $this->text, array('enableSmilies' => $this->post->enableSmilies, 'enableHtml' => $this->post->enableHtml, 'enableBBCodes' => $this->post->enableBBCodes)); } $this->executed(); // get new formatted message and return it $postList = new PostList(); $postList->sqlConditions = 'post.postID = ' . $this->postID; $postList->readPosts(); $post = reset($postList->posts); HeaderUtil::sendHeaders(); echo $post->getFormattedMessage(); }