aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2004-01-09 11:56:53 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2004-01-09 11:56:53 +0000
commit0cf61741e5213705bd1fd8e338a6444455e1e7da (patch)
tree888ef3047b92ef57f1b92b61d59ff393266d8889 /phpBB/includes/functions.php
parentd8c35f8b20463f7bfeb9f68b87d1886b52a290b4 (diff)
downloadforums-0cf61741e5213705bd1fd8e338a6444455e1e7da.tar
forums-0cf61741e5213705bd1fd8e338a6444455e1e7da.tar.gz
forums-0cf61741e5213705bd1fd8e338a6444455e1e7da.tar.bz2
forums-0cf61741e5213705bd1fd8e338a6444455e1e7da.tar.xz
forums-0cf61741e5213705bd1fd8e338a6444455e1e7da.zip
hhmm, string cleanup was rather ... broken
git-svn-id: file:///svn/phpbb/trunk@4733 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php10
1 files 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 &nbsp;, 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;
}
}