From: Zach Copley Date: Fri, 3 Apr 2009 20:19:33 +0000 (-0700) Subject: Only kill control and surrogates, leave UTF-8 formatting chars alone. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ab2946047cd08c6b66cbc57410fa8a99430530f6;p=quix0rs-gnu-social.git Only kill control and surrogates, leave UTF-8 formatting chars alone. --- diff --git a/lib/util.php b/lib/util.php index a43666fa5c..11f0f297e0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -581,10 +581,8 @@ function common_shorten_link($url, $reverse = false) function common_xml_safe_str($str) { - $xmlStr = htmlentities(iconv('UTF-8', 'UTF-8//IGNORE', $str), ENT_NOQUOTES, 'UTF-8'); - - // Replace control, formatting, and surrogate characters with '*', ala Twitter - return preg_replace('/[\p{Cc}\p{Cf}\p{Cs}]/u', '*', $str); + // Neutralize control codes and surrogates + return preg_replace('/[\p{Cc}\p{Cs}]/u', '*', $str); } function common_tag_link($tag)