mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/15079] Fix Emoji and rich text in Draft subject
PHPBB3-15079
This commit is contained in:
parent
fcca5c5b58
commit
0f3dbe1a30
1 changed files with 23 additions and 0 deletions
|
@ -736,6 +736,29 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && (
|
|||
$subject = (!$subject && $mode != 'post') ? $post_data['topic_title'] : $subject;
|
||||
$message = $request->variable('message', '', true);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
if ($auth->acl_get('u_emoji'))
|
||||
{
|
||||
$subject = utf8_encode_ucr($subject);
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* 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', $subject, $matches))
|
||||
{
|
||||
$character_list = implode('<br>', $matches[0]);
|
||||
|
||||
trigger_error($user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list));
|
||||
}
|
||||
}
|
||||
|
||||
if ($subject && $message)
|
||||
{
|
||||
if (confirm_box(true))
|
||||
|
|
Loading…
Add table
Reference in a new issue