File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 66use Carbon \Carbon ;
77use Illuminate \Support \Facades \Auth ;
88use Illuminate \Support \Facades \Redis ;
9+ use Symfony \Component \HttpFoundation \IpUtils ;
910use Potelo \LaravelBlockBots \Jobs \CheckIfBotIsReal ;
1011use Potelo \LaravelBlockBots \Events \UserBlockedEvent ;
1112use Potelo \LaravelBlockBots \Jobs \ProcessLogWithIpInfo ;
@@ -120,8 +121,9 @@ public function isWhitelisted()
120121 return true ;
121122 }
122123
123- //Lets verify if its on our whitelist
124- if (in_array ($ this ->client ->ip , $ this ->options ->whitelist_ips )) {
124+ $ ips = $ this ->options ->whitelist_ips ;
125+
126+ if (IpUtils::checkIp ($ this ->client ->ip , $ ips )) {
125127 //Add this to the redis list as it is faster
126128 Redis::sadd ($ this ->options ->whitelist_key , $ this ->client ->ip );
127129 if ($ this ->options ->log ) {
You can’t perform that action at this time.
0 commit comments