From d5147c2271671879de211ff85dbf07fcaef22017 Mon Sep 17 00:00:00 2001 From: Alec Date: Sat, 24 Nov 2018 12:56:33 -0500 Subject: [ticket/15879] Add core.posting_modify_default_variables Allows the modification of default variables put into post_data. Also allows you to unset variables in post_data to inherit the default ones. PHPBB3-15879 --- phpBB/posting.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'phpBB/posting.php') diff --git a/phpBB/posting.php b/phpBB/posting.php index 8d40652574..e2329d610d 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -597,6 +597,20 @@ if (isset($post_data['post_text'])) // Set some default variables $uninit = array('post_attachment' => 0, 'poster_id' => $user->data['user_id'], 'enable_magic_url' => 0, 'topic_status' => 0, 'topic_type' => POST_NORMAL, 'post_subject' => '', 'topic_title' => '', 'post_time' => 0, 'post_edit_reason' => '', 'notify_set' => 0); +/** +* This event allows you to modify the default variables for post_data, and unset them in post_data if needed +* +* @event core.posting_modify_default_variables +* @var array post_data Array with post data +* @var array uninit Array with default vars to put into post_data, if they aren't there +* @since 3.2.5-RC1 +*/ +$vars = array( + 'post_data', + 'uninit', +); +extract($phpbb_dispatcher->trigger_event('core.posting_modify_default_variables', compact($vars))); + foreach ($uninit as $var_name => $default_value) { if (!isset($post_data[$var_name])) -- cgit v1.2.1 From 087bf6fd35913152129eed97005953ac3979002a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 2 Dec 2018 12:55:02 +0100 Subject: [ticket/15893] Pass needed language class directly to format quote PHPBB3-15893 --- phpBB/posting.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/posting.php') diff --git a/phpBB/posting.php b/phpBB/posting.php index e2329d610d..59be983987 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -846,6 +846,7 @@ if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_ load_drafts($topic_id, $forum_id); } +/** @var \phpbb\textformatter\utils_interface $bbcode_utils */ $bbcode_utils = $phpbb_container->get('text_formatter.utils'); if ($submit || $preview || $refresh) @@ -1648,7 +1649,9 @@ if ($generate_quote) 'user_id' => $post_data['poster_id'], ); - phpbb_format_quote($config['allow_bbcode'], $quote_attributes, $bbcode_utils, $message_parser); + /** @var \phpbb\language\language $language */ + $language = $phpbb_container->get('language'); + phpbb_format_quote($language, $message_parser, $bbcode_utils, $bbcode_status, $quote_attributes); } if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh) -- cgit v1.2.1