Update security.php

This commit is contained in:
Namhyeon Go 2018-09-24 05:44:28 +09:00 committed by GitHub
parent c846ae2738
commit 0e7a215bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -574,5 +574,23 @@ if(!function_exists("get_generated_name")) {
}
}
if(!function_exists("check_redirect_domain")) {
function check_redirect_domain($url) {
$flag = false;
$to_resource = parse_url($url);
$to_host = str_replace("www.", "", get_value_in_array("host", $to_resource, ""));
$base_url = base_url();
$base_resource = parse_url($base_url);
$base_host = str_replace("www.", "", get_value_in_array("host", $base_resource, ""));
$flag = check_token_abuse($to_host, $base_host);
return $flag;
}
}
// start session (enable $_SESSION)
session_start();