Subversion Repositories ALCASAR

Rev

Rev 2908 | Rev 2934 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2908 Rev 2910
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: index.php 2908 2021-01-12 18:00:35Z rexy $
2
# $Id: index.php 2910 2021-01-30 14:03:44Z rexy $
3
#
3
#
4
# index.php for ALCASAR by Rexy
4
# index.php for ALCASAR by Rexy
5
# UI & css style by stephane ERARD
5
# UI & css style by stephane ERARD
6
# The contents of this file may be used under the terms of the GNU
6
# The contents of this file may be used under the terms of the GNU
7
# General Public License Version 2, provided that the above copyright
7
# General Public License Version 2, provided that the above copyright
Line 495... Line 495...
495
// Search blacklist categories
495
// Search blacklist categories
496
if ((!$direct_access) && (!$network_pb) && (!isset($_GET['warn']))) {
496
if ((!$direct_access) && (!$network_pb) && (!isset($_GET['warn']))) {
497
	$pattern = str_replace('www.', '', $_SERVER['HTTP_HOST']);
497
	$pattern = str_replace('www.', '', $_SERVER['HTTP_HOST']);
498
	$categories = [];
498
	$categories = [];
499
	exec('grep -Re ' . escapeshellarg('^'.$pattern.'$') . " /etc/e2guardian/lists/blacklists/*/domains | cut -d'/' -f6", $categories);
499
	exec('grep -Re ' . escapeshellarg('^'.$pattern.'$') . " /etc/e2guardian/lists/blacklists/*/domains | cut -d'/' -f6", $categories);
500
 
-
 
501
	$filteredUrlHtml = $l_required_domain.' : '.htmlspecialchars($_SERVER['HTTP_HOST']);
500
	$filteredUrlHtml = $l_required_domain.' : '.htmlspecialchars($_SERVER['HTTP_HOST']);
-
 
501
	if (empty($categories)) { // try again to search the category removing the prefix of the domain name
-
 
502
		$tiny_pattern = substr(stristr($pattern, '.'), 1);
-
 
503
		exec('grep -Re ' . escapeshellarg('^'.$tiny_pattern.'$') . " /etc/e2guardian/lists/blacklists/*/domains | cut -d'/' -f6", $categories);
-
 
504
	}
502
	if (!empty($categories)) {
505
	if (!empty($categories)) {
503
		$filteredUrlHtml .= "<br>$l_category ".implode(', ', $categories);
506
		$filteredUrlHtml .= "<br>$l_category ".implode(', ', $categories);
504
	}
507
	}
505
}
508
}
506
////////////////////////////////////////////////////////////////////////
509
////////////////////////////////////////////////////////////////////////