diff options
Diffstat (limited to 'functions/init/sanitize.php')
-rw-r--r-- | functions/init/sanitize.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/functions/init/sanitize.php b/functions/init/sanitize.php index db21021..5d72cad 100644 --- a/functions/init/sanitize.php +++ b/functions/init/sanitize.php @@ -32,6 +32,22 @@ function recursiveSanitize($value) { return $value; } + +function sanitizeForWeb($string) { + $string = preg_replace('/<br\s*\/?>/', "\n", $string); + + $string = str_replace('&', '&', $string); + $string = str_replace('<', '<', $string); + $string = str_replace('>', '>', $string); + $string = str_replace('\'', ''', $string); + $string = str_replace('"', '"', $string); + + $string = str_replace('<br />', "\n", $string); + + return $string; +} + + if (!isset($_SERVER) && isset($HTTP_SERVER_VARS)) { $_SERVER = &$HTTP_SERVER_VARS; } |