diff options
author | Marc Alexander <admin@m-a-styles.de> | 2019-11-01 22:12:24 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-11-01 22:12:24 +0100 |
commit | 51f0c16b5f14490c286d5484756fd075f2dc207a (patch) | |
tree | 0d53b73f38d17c7884e883d9a53177ffa98bcff0 /phpBB/posting.php | |
parent | e95e387188b050c163edcce3141c957d259810c9 (diff) | |
parent | ff25d0a5084e5e79bf7cc9faefd0dfdeb0ef5705 (diff) | |
download | forums-51f0c16b5f14490c286d5484756fd075f2dc207a.tar forums-51f0c16b5f14490c286d5484756fd075f2dc207a.tar.gz forums-51f0c16b5f14490c286d5484756fd075f2dc207a.tar.bz2 forums-51f0c16b5f14490c286d5484756fd075f2dc207a.tar.xz forums-51f0c16b5f14490c286d5484756fd075f2dc207a.zip |
Merge pull request #5685 from 3D-I/ticket/16153
[ticket/16153] Enable Emojis and rich text in Topic title
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 595d0f0c06..a0ddb9ff15 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1181,11 +1181,23 @@ if ($submit || $preview || $refresh) $error[] = $user->lang['EMPTY_SUBJECT']; } - // Check for out-of-bounds characters that are currently - // not supported by utf8_bin in MySQL + /** + * Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR. + * Using their Numeric Character Reference's Hexadecimal notation. + */ + $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)) { - $character_list = implode('<br />', $matches[0]); + $character_list = implode('<br>', $matches[0]); + $error[] = $user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list); } |