1
0
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:
Thomas Zilio
2019-09-24 10:09:29 +02:00
parent d01377e984
commit 5412002e55
13 changed files with 417 additions and 55 deletions

View File

@ -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;
}