]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only kill control and surrogates, leave UTF-8 formatting chars alone.
authorZach Copley <zach@controlyourself.ca>
Fri, 3 Apr 2009 20:19:33 +0000 (13:19 -0700)
committerZach Copley <zach@controlyourself.ca>
Fri, 3 Apr 2009 20:19:33 +0000 (13:19 -0700)
lib/util.php

index a43666fa5c40f77a131c7fe830ba657447e0587e..11f0f297e0503485cd3d03412dba7b4ad131ea2e 100644 (file)
@@ -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)