mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
finally got rid of ancient method sanitizeString()
This commit is contained in:
parent
c31d12b44c
commit
9fcebb898a
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user