aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_forums.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-10-28 20:22:52 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-10-28 20:22:52 +0100
commitc0eee6d153f63faf5231edd03ee8e5c5412d41dc (patch)
treeaf23d5013860922003d2a1a22c564464202e81ae /phpBB/includes/acp/acp_forums.php
parent1b20430399c19069e197146cbca081ec868c1282 (diff)
parent2cdc2e751eb03b6ba6c34889dc3db2a301b8c326 (diff)
downloadforums-c0eee6d153f63faf5231edd03ee8e5c5412d41dc.tar
forums-c0eee6d153f63faf5231edd03ee8e5c5412d41dc.tar.gz
forums-c0eee6d153f63faf5231edd03ee8e5c5412d41dc.tar.bz2
forums-c0eee6d153f63faf5231edd03ee8e5c5412d41dc.tar.xz
forums-c0eee6d153f63faf5231edd03ee8e5c5412d41dc.zip
Merge pull request #5682 from 3D-I/ticket/16151
[ticket/16151] Enable Emojis and rich text in forum name
Diffstat (limited to 'phpBB/includes/acp/acp_forums.php')
-rw-r--r--phpBB/includes/acp/acp_forums.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 668f2f8ebd..22c775b7c3 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -986,10 +986,20 @@ class acp_forums
$errors[] = $user->lang['FORUM_NAME_EMPTY'];
}
- // No Emojis
+ /**
+ * Replace Emojis and other 4bit UTF-8 chars not allowed by MySql to UCR / NCR.
+ * Using their Numeric Character Reference's Hexadecimal notation.
+ */
+ $forum_data_ary['forum_name'] = utf8_encode_ucr($forum_data_ary['forum_name']);
+
+ /**
+ * This should never happen again.
+ * Leaving the fallback here just in case there will be the need of it.
+ */
if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $forum_data_ary['forum_name'], $matches))
{
$character_list = implode('<br>', $matches[0]);
+
$errors[] = $user->lang('FORUM_NAME_EMOJI', $character_list);
}