mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Merge branch 'feature/ipfilter' into develop
This commit is contained in:
commit
8a7e5a8794
11 changed files with 165 additions and 53 deletions
|
|
@ -265,6 +265,7 @@ if(!defined('__XE_LOADED_CLASS__'))
|
|||
require(_XE_PATH_ . 'classes/validator/Validator.class.php');
|
||||
require(_XE_PATH_ . 'classes/frontendfile/FrontEndFileHandler.class.php');
|
||||
require(_XE_PATH_ . 'classes/security/Security.class.php');
|
||||
require(_XE_PATH_ . 'classes/security/IpFilter.class.php');
|
||||
if(__DEBUG__)
|
||||
$GLOBALS['__elapsed_class_load__'] = getMicroTime() - __ClassLoadStartTime__;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1318,7 +1318,7 @@ function isCrawler($agent = NULL)
|
|||
|
||||
$check_agent = array('bot', 'spider', 'google', 'yahoo', 'daum', 'teoma', 'fish', 'hanrss', 'facebook');
|
||||
$check_ip = array(
|
||||
'211.245.21.11*' /* mixsh */
|
||||
'211.245.21.110-211.245.21.119' /* mixsh */
|
||||
);
|
||||
|
||||
foreach($check_agent as $str)
|
||||
|
|
@ -1329,17 +1329,7 @@ function isCrawler($agent = NULL)
|
|||
}
|
||||
}
|
||||
|
||||
$check_ip = '/^(' . implode($check_ip, '|') . ')/';
|
||||
$check_ip = str_replace('.', '\.', $check_ip);
|
||||
$check_ip = str_replace('*', '.+', $check_ip);
|
||||
$check_ip = str_replace('?', '.?', $check_ip);
|
||||
|
||||
if(preg_match($check_ip, $_SERVER['REMOTE_ADDR'], $matches))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return IpFilter::filter($check_ip, '211.245.21.113');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue