hhmm, string cleanup was rather ... broken

git-svn-id: file:///svn/phpbb/trunk@4733 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2004-01-09 11:56:53 +00:00
parent d8c35f8b20
commit 0cf61741e5

View file

@ -19,13 +19,9 @@ function set_var(&$result, $var, $type)
if ($type == 'string') if ($type == 'string')
{ {
// Prevent use of  , excess spaces or other html entity forms in profile strings, $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r", '\xFF'), array("\n", "\n", ' '), $result)));
// not generally applicable elsewhere $result = preg_replace("#\n{3,}#", "\n\n", $result);
$result = htmlspecialchars(trim(preg_replace(array("#[ \xFF]{2,}#s", "#[\r\n]{2,}#s"), array(' ', "\n"), $result))); $result = (STRIP) ? stripslashes($result) : $result;
if (STRIP)
{
$result = stripslashes($result);
}
} }
} }