mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
issue 1393 improve denied ip check method
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10180 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ccaef66214
commit
e29246c222
1 changed files with 2 additions and 7 deletions
|
|
@ -44,15 +44,10 @@
|
|||
if(!count($ip_list)) return new Object();
|
||||
|
||||
$count = count($ip_list);
|
||||
$patterns = array();
|
||||
for($i=0;$i<$count;$i++) {
|
||||
$ip = str_replace('*','',$ip_list[$i]->ipaddress);
|
||||
$patterns[] = preg_quote($ip);
|
||||
$ip = str_replace('.', '\.', str_replace('*','(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',$ip_list[$i]->ipaddress));
|
||||
if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip');
|
||||
}
|
||||
|
||||
$pattern = '/^('.implode($patterns,'|').')/';
|
||||
|
||||
if(preg_match($pattern, $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue