diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 9b65b958c..69780e777 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -166,53 +166,6 @@ function getReadableDurationArray($secs) { /* {{{ */ return $units; } /* }}} */ -// -// The original string sanitizer, kept for reference. -//function sanitizeString($string) { -// $string = str_replace("'", "'", $string); -// $string = str_replace("--", "", $string); -// $string = str_replace("<", "<", $string); -// $string = str_replace(">", ">", $string); -// $string = str_replace("/*", "", $string); -// $string = str_replace("*/", "", $string); -// $string = str_replace("\"", """, $string); -// -// return $string; -//} - -/* Deprecated, do not use anymore */ -function sanitizeString($string) { /* {{{ */ - - $string = (string) $string; - if (get_magic_quotes_gpc()) { - $string = stripslashes($string); - } - - // The following three are against sql injection. They are not - // needed anymore because strings are quoted propperly when saved into - // the database. -// $string = str_replace("\\", "\\\\", $string); -// $string = str_replace("--", "\-\-", $string); -// $string = str_replace(";", "\;", $string); - // Use HTML entities to represent the other characters that have special - // meaning in SQL. These can be easily converted back to ASCII / UTF-8 - // with a decode function if need be. - $string = str_replace("&", "&", $string); - $string = str_replace("%", "%", $string); // percent - $string = str_replace("\"", """, $string); // double quote - $string = str_replace("/*", "/*", $string); // start of comment - $string = str_replace("*/", "*/", $string); // end of comment - $string = str_replace("<", "<", $string); - $string = str_replace(">", ">", $string); - $string = str_replace("=", "=", $string); - $string = str_replace(")", ")", $string); - $string = str_replace("(", "(", $string); - $string = str_replace("'", "'", $string); - $string = str_replace("+", "+", $string); - - return trim($string); -} /* }}} */ - /* Deprecated, do not use anymore, but keep it for upgrading * older versions */