1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +02:00

Merge branch '3.2.x' into 3.3.x

This commit is contained in:
Marc Alexander
2019-11-01 22:12:29 +01:00
3 changed files with 21 additions and 13 deletions

View File

@@ -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);
}