From 7df35e813132d8941fbcfc99226b48fc7e2dbe10 Mon Sep 17 00:00:00 2001
From: 3D-I <480857+3D-I@users.noreply.github.com>
Date: Thu, 14 May 2020 20:57:42 +0200
Subject: [PATCH] [ticket/16480] Fix Emoji in report post

PHPBB3-16480
---
 phpBB/phpbb/report/controller/report.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/phpBB/phpbb/report/controller/report.php b/phpBB/phpbb/report/controller/report.php
index 0aa6833dfa..a8f4abf338 100644
--- a/phpBB/phpbb/report/controller/report.php
+++ b/phpBB/phpbb/report/controller/report.php
@@ -105,6 +105,12 @@ class report
 		$reason_id		= $this->request->variable('reason_id', 0);
 		$report_text	= $this->request->variable('report_text', '', true);
 
+		/**
+		 * Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR.
+		 * Using their Numeric Character Reference's Hexadecimal notation.
+		 */
+		$report_text	= utf8_encode_ucr($report_text);
+
 		$submit = $this->request->variable('submit', '');
 		$cancel = $this->request->variable('cancel', '');