From 518b4e39a8c40031c799b6783adc12d3e3a90c80 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 7 Oct 2013 17:16:18 +0200 Subject: [PATCH] removing control chars in messages --- wcfsetup/install/files/lib/util/MessageUtil.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wcfsetup/install/files/lib/util/MessageUtil.class.php b/wcfsetup/install/files/lib/util/MessageUtil.class.php index 0cceed34e3..6c52f0eeb1 100644 --- a/wcfsetup/install/files/lib/util/MessageUtil.class.php +++ b/wcfsetup/install/files/lib/util/MessageUtil.class.php @@ -35,6 +35,9 @@ class MessageUtil { // remove emoji (MySQL 5.1 does not support them) $text = preg_replace('~\xF0\x9F[\x80-\xBF][\x80-\xBF]~', '', $text); + // remove control characters + $text = preg_replace('~[\x00-\x08\x0B-\x1F\x7F]~', '', $text); + return $text; } -- 2.20.1