mirror of
https://github.com/pi-hole/web.git
synced 2025-12-27 05:56:22 +00:00
15 lines
322 B
PHP
15 lines
322 B
PHP
<?php
|
|
if(!isset($_GET['list']))
|
|
die();
|
|
|
|
$type = $_GET['list'];
|
|
$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]);
|
|
}
|
|
|
|
echo json_encode(array_values($list)); |