From d18e5473327fe7edf1fdaec13db8a9079a2168ac Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 10 Aug 2019 21:02:39 +0200 Subject: [PATCH] [ticket/15897] Fix Emojis' SQL Error in Attachment Comment PHPBB3-15897 --- phpBB/includes/functions_posting.php | 5 +++++ phpBB/language/en/posting.php | 1 + 2 files changed, 6 insertions(+) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index c5a7400ddf..2cce77e092 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2079,6 +2079,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data continue; } + if (preg_match('/[\x{10000}-\x{10FFFF}]/u', $attach_row['attach_comment'])) + { + trigger_error('ATTACH_COMMENT_NO_EMOJIS'); + } + if (!$attach_row['is_orphan']) { // update entry in db if attachment already stored in db and filespace diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 11ea6483e1..426475e77a 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -43,6 +43,7 @@ $lang = array_merge($lang, array( 'ADD_POLL' => 'Poll creation', 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', 'ALREADY_DELETED' => 'Sorry but this message is already deleted.', + 'ATTACH_COMMENT_NO_EMOJIS' => 'The attachment comment contains forbidden characters (Emoji).', 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment.', 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)',