aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
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  , 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;
}
}