--- /dev/null
+<?php
+namespace wcf\data;
+
+/**
+ * Default interface for actions implementing quick reply with parameter validation.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2018 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage data
+ * @category Community Framework
+ */
+interface IMessageQuickReplyParametersAction extends IMessageQuickReplyAction {
+ /**
+ * Returns the list of allowed data parameters for the 'quickReply' action. The
+ * 'message' key is permitted by default.
+ *
+ * @return string[]
+ */
+ public function getAllowedQuickReplyParameters();
+}
use wcf\data\IAttachmentMessageQuickReplyAction;
use wcf\data\IMessage;
use wcf\data\IMessageQuickReplyAction;
+use wcf\data\IMessageQuickReplyParametersAction;
use wcf\system\bbcode\PreParser;
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
unset($parameters['data']['tmpHash']);
}
+ $allowedDataParameters = array('message');
+ if ($object instanceof IMessageQuickReplyParametersAction) {
+ $allowedDataParameters = array_merge($allowedDataParameters, $object->getAllowedQuickReplyParameters());
+ }
+ $eventParameters = array(
+ 'allowedDataParameters' => $allowedDataParameters,
+ 'object' => $object
+ );
+ EventHandler::getInstance()->fireAction($this, 'allowedDataParameters', $eventParameters);
+ $allowedDataParameters = $eventParameters['allowedDataParameters'];
+
+ foreach ($parameters['data'] as $key => $value) {
+ if (!in_array($key, $allowedDataParameters)) {
+ unset($parameters['data'][$key]);
+ }
+ }
+
// message settings
$parameters['data'] = array_merge($parameters['data'], MessageFormSettingsHandler::getSettings($parameters));