497,8 → 497,11 |
$pattern = str_replace('www.', '', $_SERVER['HTTP_HOST']); |
$categories = []; |
exec('grep -Re ' . escapeshellarg('^'.$pattern.'$') . " /etc/e2guardian/lists/blacklists/*/domains | cut -d'/' -f6", $categories); |
|
$filteredUrlHtml = $l_required_domain.' : '.htmlspecialchars($_SERVER['HTTP_HOST']); |
if (empty($categories)) { // try again to search the category removing the prefix of the domain name |
$tiny_pattern = substr(stristr($pattern, '.'), 1); |
exec('grep -Re ' . escapeshellarg('^'.$tiny_pattern.'$') . " /etc/e2guardian/lists/blacklists/*/domains | cut -d'/' -f6", $categories); |
} |
if (!empty($categories)) { |
$filteredUrlHtml .= "<br>$l_category ".implode(', ', $categories); |
} |