Revert "Merge pull request #267 from pi-hole/folderStructure"

This reverts commit fba3d10fa4, reversing
changes made to 4ee75f4167.
This commit is contained in:
DL6ER
2016-12-21 17:16:52 +01:00
parent fba3d10fa4
commit e188cb6fbc
83 changed files with 183 additions and 174 deletions

View File

@@ -1,33 +0,0 @@
<?php
if(!isset($_GET['list']))
die();
$type = $_GET['list'];
if($type !== "white" && $type !== "black")
die("Invalid list parameter");
$rawList = file_get_contents("/etc/pihole/${type}list.txt");
$list = explode("\n", $rawList);
// Get rid of empty lines
for($i = sizeof($list)-1; $i >= 0; $i--) {
if($list[$i] == "")
unset($list[$i]);
}
function filterArray(&$inArray) {
$outArray = array();
foreach ($inArray as $key=>$value) {
if (is_array($value)) {
$outArray[htmlspecialchars($key)] = filterArray($value);
} else {
$outArray[htmlspecialchars($key)] = htmlspecialchars($value);
}
}
return $outArray;
}
// Protect against XSS attacks
$list = filterArray($list);
echo json_encode(array_values($list));