]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Ticket #2811 use more consistent max limit for OAuth application registration descrip...
[quix0rs-gnu-social.git] / lib / util.php
index 35fcfdb090a7f862b446fc6f77e09e61e82d3d12..c05fcf15a2a052ea86d1b6d961c1a2f1dc22da29 100644 (file)
@@ -919,7 +919,12 @@ function common_shorten_links($text, $always = false)
 function common_validate_utf8($str)
 {
     // preg_replace will return NULL on invalid UTF-8 input.
-    return preg_replace('//u', '', $str);
+    //
+    // Note: empty regex //u also caused NULL return on some
+    // production machines, but none of our test machines.
+    //
+    // This should be replaced with a more reliable check.
+    return preg_replace('/\x00/u', '', $str);
 }
 
 /**