diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index f22ee7d9cd4787288380c208edb2ae5af1060075..ad8402ff2f67a87f82b4ed2604e5f3f1b68b1abc 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -281,7 +281,7 @@ class SettingsController extends Controller $blacklist = substr($blacklist, 0, stripos($blacklist, '/')); } - $regexUrl = '#^[a-z0-9.]*$#'; + $regexUrl = '#^(\*\.)?[a-z0-9.]*$#'; if(preg_match($regexUrl, $blacklist) == 1){ $path = \Request::path(); diff --git a/app/MetaGer.php b/app/MetaGer.php index 84dbfe0586e33e59f4aeb241c53a633dafdca67d..5c856dec5532a350ce3941c62e25c81f3f6f582a 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -5,6 +5,7 @@ namespace App; use App; use Cache; use Carbon; +use Cookie; use Illuminate\Http\Request; use Illuminate\Support\Facades\Redis; use Jenssegers\Agent\Agent; @@ -1352,6 +1353,14 @@ class MetaGer } } + foreach(Cookie::get() as $key => $value){ + if(stripos($key, 'blpage') !== false && stripos($value, '*.') === false){ + $this->hostBlacklist[] = $value; + } + } + + array_unique($this->hostBlacklist); + // print the host blacklist as a user warning if (sizeof($this->hostBlacklist) > 0) { $hostString = ""; @@ -1386,6 +1395,15 @@ class MetaGer $this->domainBlacklist[] = substr($blacklistString, strpos($blacklistString, "*.") + 2); } } + + foreach(Cookie::get() as $key => $value){ + if(stripos($key, 'blpage') !== false && stripos($value, '*.') !== false){ + $this->domainBlacklist[] = $value; + } + } + + array_unique($this->domainBlacklist); + // print the domain blacklist as a user warning if (sizeof($this->domainBlacklist) > 0) { $domainString = "";