This commit is contained in:
parent
7b8a66c1d4
commit
a6daece140
1 changed files with 8 additions and 2 deletions
|
@ -88,8 +88,14 @@ function strip($_data) {
|
||||||
}
|
}
|
||||||
// escape input for mysql
|
// escape input for mysql
|
||||||
function escape_for_mysql($_data) {
|
function escape_for_mysql($_data) {
|
||||||
if (is_array($_data)) foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val);
|
if (is_array($_data))
|
||||||
else $_data = mysql_escape_string($_data);
|
foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val);
|
||||||
|
else
|
||||||
|
$_data = mysql_real_escape_string($_data);
|
||||||
|
// uses last opened MySQL link implicitly
|
||||||
|
// assumption is valid because this function is never called
|
||||||
|
// before mysql_connect
|
||||||
|
|
||||||
return $_data;
|
return $_data;
|
||||||
}
|
}
|
||||||
// htmlspecialchars a whole array
|
// htmlspecialchars a whole array
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue