diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-07 13:32:26 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-07 13:32:26 -0700 |
commit | 6c959c83ce528614f6e0837cf022d1a67b64b73c (patch) | |
tree | be103b910d3df8be06c8f479c9e24bd05b92d65c /lib | |
parent | 71176b9a98ef5298162f821c621a0e467dd9570b (diff) | |
parent | 781075d4bc74296118bbf6f64565ab3aeb0a3a86 (diff) |
Merge branch '0.9.x' into 1.0.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php index df339d4b1..85d7c72f4 100644 --- a/lib/util.php +++ b/lib/util.php @@ -946,7 +946,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); } /** |