mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
in findAds: ensure count($exploded) == 8
This commit is contained in:
@@ -267,13 +267,18 @@
|
||||
|
||||
function findAds($var) {
|
||||
$exploded = explode(" ", $var);
|
||||
$tmp = $exploded[count($exploded)-4];
|
||||
$tmp2 = $exploded[count($exploded)-5];
|
||||
$tmp3 = $exploded[count($exploded) -3];
|
||||
$hostname = trim(file_get_contents("/etc/hostname"), "\x00..\x1F");
|
||||
if(count($exploded) == 8) {
|
||||
$tmp = $exploded[count($exploded) - 4];
|
||||
$tmp2 = $exploded[count($exploded) - 5];
|
||||
$tmp3 = $exploded[count($exploded) - 3];
|
||||
$hostname = trim(file_get_contents("/etc/hostname"), "\x00..\x1F");
|
||||
//filter out bad names and host file reloads:
|
||||
return (substr($tmp, strlen($tmp) - 12, 12) == "gravity.list" && $tmp2 != "read" && $tmp3 != "pi.hole" && $tmp3 != $hostname);
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
|
||||
//filter out bad names and host file reloads:
|
||||
return (substr($tmp, strlen($tmp) - 12, 12) == "gravity.list" && $tmp2 != "read" && $tmp3 != "pi.hole" && $tmp3 != $hostname) ;
|
||||
}
|
||||
|
||||
function findForwards($var) {
|
||||
|
||||
Reference in New Issue
Block a user