1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/16151] Enable Emojis and rich text in forum name

Move to a new function()

PHPBB3-16151
This commit is contained in:
3D-I
2019-10-28 02:34:59 +01:00
parent 6600fc6cad
commit 2cdc2e751e
2 changed files with 34 additions and 25 deletions

View File

@@ -987,24 +987,14 @@ class acp_forums
}
/**
* Replace Emojis and other 4bit UTF-8 chars not allowed by MySql to NCR.
* Replace Emojis and other 4bit UTF-8 chars not allowed by MySql to UCR / NCR.
* Using their Numeric Character Reference's Hexadecimal notation.
* Doesn't interfere with Japanese or Cyrillic etc.
*
* @see https://www.w3.org/TR/xml11/
* @see https://www.opentag.com/xfaq_charrep.htm
*/
if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $forum_data_ary['forum_name'], $matches))
{
foreach ($matches as $key => $emoji)
{
$forum_data_ary['forum_name'] = str_replace($emoji, utf8_encode_ncr($emoji), $forum_data_ary['forum_name']);
}
}
$forum_data_ary['forum_name'] = utf8_encode_ucr($forum_data_ary['forum_name']);
/**
* This should never happen again.
* Leaving the fallback hre just in case there will be the need of it.
* 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))
{