From d6427e777c6208485714db08902088e73459088d Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Thu, 24 Dec 2020 00:04:36 +0100 Subject: [PATCH] [ticket/16665] Fix Emoji for strings in board settings PHPBB3-16665 --- phpBB/includes/acp/acp_board.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 968c9762cc..9001459928 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -582,7 +582,20 @@ class acp_board continue; } - $config->set($config_name, $config_value); + $config_name_ary = ['sitename', 'site_desc', 'site_home_text', 'board_index_text', 'board_disable_msg']; + + if (in_array($config_name, $config_name_ary)) + { + /** + * Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR. + * Using their Numeric Character Reference's Hexadecimal notation. + */ + $config->set($config_name, utf8_encode_ucr($config_value)); + } + else + { + $config->set($config_name, $config_value); + } if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable'])) {