mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Supporto liste per le newsletter
This commit is contained in:
@ -375,3 +375,17 @@ function clean($string, $permitted = '')
|
||||
{
|
||||
return preg_replace('/[^A-Za-z0-9'.$permitted.']/', '', $string); // Removes special chars.
|
||||
}
|
||||
|
||||
function check_query($query)
|
||||
{
|
||||
$query = mb_strtoupper($query);
|
||||
|
||||
$blacklist = ['INSERT', 'UPDATE', 'TRUNCATE', 'DELETE', 'DROP', 'GRANT', 'CREATE', 'REVOKE'];
|
||||
foreach ($blacklist as $value) {
|
||||
if (preg_match("/\b".preg_quote($value)."\b/", $query)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user