Created
February 11, 2020 22:57
-
-
Save wilnaweb/20a9ffbc44033c6636fa00c2f0fed7e5 to your computer and use it in GitHub Desktop.
Check if exist sql command into string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function existSqlCommand($param){ | |
$notAllowedCommands = array( | |
'DELETE', | |
'TRUNCATE', | |
'DROP', | |
'SELECT', | |
'UPDATE' | |
); | |
if(preg_match('[' . implode(' |', $notAllowedCommands ) . ']i', $param) == true) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment