Update security.php

This commit is contained in:
Namhyeon Go 2018-03-07 10:47:12 +09:00 committed by GitHub
parent 1a69407a8d
commit aad5a4fa6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,14 +66,14 @@ if(!function_exists("get_session_token")) {
}
if(!function_exists("check_token_abuse_by_requests")) {
function check_token_abuse_by_requests($name) {
function check_token_abuse_by_requests($name, $method="_POST") {
global $requests;
$flag = false;
if(array_key_empty($name, $requests['_POST'])) {
if(array_key_empty($name, $requests[$method])) {
$flag = true;
} else {
$flag = check_token_abuse($requests['_POST'][$name], get_session($name));
$flag = check_token_abuse($requests[$method][$name], get_session($name));
}
return $flag;