From: Marcel Werk Date: Mon, 7 Oct 2013 15:16:18 +0000 (+0200) Subject: removing control chars in messages X-Git-Tag: 2.0.0_Beta_11~66 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=518b4e39a8c40031c799b6783adc12d3e3a90c80;p=GitHub%2FWoltLab%2FWCF.git removing control chars in messages --- 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; }