Skip to content

Commit 0422e4d

Browse files
committed
updated blocklist plugin
1 parent 0f501a3 commit 0422e4d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Plugin/BlockListPlugin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ function onBeforeRequest(ProxyEvent $event){
2727
return;
2828
}
2929

30+
// url filter!
31+
$url_block = (array)Config::get('blocklist.url_block');
32+
foreach($url_block as $ub){
33+
34+
if(strpos($url, $ub) !== false){
35+
throw new \Exception("Error: Access to {$url} has been blocked!");
36+
return;
37+
}
38+
}
39+
3040
/*
3141
1. Wildcard format: 1.2.3.*
3242
2. CIDR format: 1.2.3/24 OR 1.2.3.4/255.255.255.0

0 commit comments

Comments
 (0)