Expand then limit query string NULL mods to insert statements only.
This commit is contained in:
parent
9dddaee8b3
commit
4a404f25f2
|
|
@ -62,8 +62,16 @@
|
|||
|
||||
if (!function_exists('check_sql')) {
|
||||
function check_sql($string) {
|
||||
// if insert statement
|
||||
if (strpos(strtolower(trim($string)), "insert") == 0) {
|
||||
$string = str_replace(" ''", " null", $string);
|
||||
return trim($string); //remove white space
|
||||
$string = str_replace(",''", ",null", $string);
|
||||
$string = str_replace("'',", "null,", $string);
|
||||
$string = str_replace("(''", "(null", $string);
|
||||
$string = str_replace("'')", "null)", $string);
|
||||
$string = str_replace("'' )", "null )", $string);
|
||||
}
|
||||
return trim($string); //remove white space ADD TRIM BACK IN!
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue