We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 5e0f3e7b authored by Brion Vibber's avatar Brion Vibber

Workaround for regression in input validation due to more PCRE oddities....

Workaround for regression in input validation due to more PCRE oddities. Recommend redoing common_validate_utf8() using something more reliable, perhaps. :P
parent 458f93bd
......@@ -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);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment