A better way to block injections

This commit is contained in:
Laurent Destailleur 2011-03-07 23:15:44 +00:00
parent ecee1ec547
commit 7bd03b3b98

View File

@ -87,13 +87,6 @@ function analyse_sql_and_script(&$var,$get)
{ {
foreach ($var as $key => $value) foreach ($var as $key => $value)
{ {
/*if (test_sql_and_script_inject($key,$get) > 0) // We do not check key, only values
{
print 'Access refused by SQL/Script injection protection in main.inc.php';
exit;
}
else
{*/
if (analyse_sql_and_script($value,$get)) if (analyse_sql_and_script($value,$get))
{ {
$var[$key] = $value; $var[$key] = $value;
@ -103,7 +96,6 @@ function analyse_sql_and_script(&$var,$get)
print 'Access refused by SQL/Script injection protection in main.inc.php'; print 'Access refused by SQL/Script injection protection in main.inc.php';
exit; exit;
} }
/*}*/
} }
return true; return true;
} }