diff options
author | Marc Alexander <admin@m-a-styles.de> | 2020-01-02 09:59:25 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2020-01-02 09:59:25 +0100 |
commit | db5121511d09aa6f19644dfa6fe47d760c4355f9 (patch) | |
tree | c0003b620775417674c92d110ab7a145f1a7b8ca /phpBB/posting.php | |
parent | b9193f35c1d964e3445d3933d877be3049954411 (diff) | |
parent | 0806d34eee9a302bb8a699ee49f04b0592aa06c6 (diff) | |
download | forums-db5121511d09aa6f19644dfa6fe47d760c4355f9.tar forums-db5121511d09aa6f19644dfa6fe47d760c4355f9.tar.gz forums-db5121511d09aa6f19644dfa6fe47d760c4355f9.tar.bz2 forums-db5121511d09aa6f19644dfa6fe47d760c4355f9.tar.xz forums-db5121511d09aa6f19644dfa6fe47d760c4355f9.zip |
Merge pull request #5802 from 3D-I/ticket/16279
[ticket/16279] Add permission for Emoji in topic title
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index c5d0693f35..c4042e48e6 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('<br>', $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('<br>', $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; |