From 0cf61741e5213705bd1fd8e338a6444455e1e7da Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Fri, 9 Jan 2004 11:56:53 +0000 Subject: [PATCH] hhmm, string cleanup was rather ... broken git-svn-id: file:///svn/phpbb/trunk@4733 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bf93798ca7..6d469f2a3d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -19,13 +19,9 @@ function set_var(&$result, $var, $type) if ($type == 'string') { - // Prevent use of  , excess spaces or other html entity forms in profile strings, - // not generally applicable elsewhere - $result = htmlspecialchars(trim(preg_replace(array("#[ \xFF]{2,}#s", "#[\r\n]{2,}#s"), array(' ', "\n"), $result))); - if (STRIP) - { - $result = stripslashes($result); - } + $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r", '\xFF'), array("\n", "\n", ' '), $result))); + $result = preg_replace("#\n{3,}#", "\n\n", $result); + $result = (STRIP) ? stripslashes($result) : $result; } }