1 <?php
2
3 /*
4 * This file is part of the Icybee package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Icybee\Modules\Comments;
13
14 /**
15 * Gives the user a visual feedback of the message he's typing.
16 */
17 class PreviewOperation extends \ICanBoogie\Operation
18 {
19 protected function validate(\ICanboogie\Errors $errors)
20 {
21 return $this->request['contents'];
22 }
23
24 protected function process()
25 {
26 $contents = $this->request['contents'];
27 $contents = \Textmark_Parser::parse($contents);
28
29 return \Icybee\Kses::sanitizeComment($contents);
30 }
31 }