Commit 4fcdc941 authored by Davide Aprea's avatar Davide Aprea

added cookie black list to search

parent 8097fc40
......@@ -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();
......
......@@ -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 = "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment