From e46d8d329d6f976ea0be50414a5fe245410ca20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Mon, 1 Oct 2018 15:16:42 +0200 Subject: [ticket/15244] Remove unglobalise related code PHPBB3-15244 --- phpBB/posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/posting.php') diff --git a/phpBB/posting.php b/phpBB/posting.php index 75085a5635..eba4d9f0a9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -40,7 +40,7 @@ $load = (isset($_POST['load'])) ? true : false; $confirm = $request->is_set_post('confirm'); $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; -$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load || $preview); +$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load || $preview); $submit = $request->is_set_post('post') && !$refresh && !$preview; $mode = $request->variable('mode', ''); -- cgit v1.2.1 From 364461b58fd40af8fe8c7513fe9424de483055b9 Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Mon, 30 Dec 2019 02:25:26 +0100 Subject: [ticket/16279] Add permission for Emoji in topic title PHPBB3-16279 --- phpBB/posting.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'phpBB/posting.php') diff --git a/phpBB/posting.php b/phpBB/posting.php index 59616a2858..57b52320a3 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1184,21 +1184,24 @@ if ($submit || $preview || $refresh) /** * Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR. * Using their Numeric Character Reference's Hexadecimal notation. + * Check the permissions for posting Emojis first. */ - $post_data['post_subject'] = utf8_encode_ucr($post_data['post_subject']); - - /** - * This should never happen again. - * Leaving the fallback here just in case there will be the need of it. - * - * Check for out-of-bounds characters that are currently - * not supported by utf8_bin in MySQL - */ - if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $post_data['post_subject'], $matches)) + if ($auth->acl_get('u_emoji')) + { + $post_data['post_subject'] = utf8_encode_ucr($post_data['post_subject']); + } + else { - $character_list = implode('
', $matches[0]); + /** + * Check for out-of-bounds characters that are currently + * not supported by utf8_bin in MySQL + */ + if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $post_data['post_subject'], $matches)) + { + $character_list = implode('
', $matches[0]); - $error[] = $user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list); + $error[] = $user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list); + } } $post_data['poll_last_vote'] = (isset($post_data['poll_last_vote'])) ? $post_data['poll_last_vote'] : 0; -- cgit v1.2.1