mirror of
https://github.com/pi-hole/web.git
synced 2025-12-27 13:59:14 +00:00
Add api.php?version
This commit is contained in:
12
api_FTL.php
12
api_FTL.php
@@ -21,6 +21,12 @@ header('Content-type: application/json');
|
||||
|
||||
$data = [];
|
||||
|
||||
if (isset($_GET['version'])) {
|
||||
$version = array();
|
||||
$version["version"] = "FTL";
|
||||
$data = array_merge($data, $version);
|
||||
}
|
||||
|
||||
if (isset($_GET['summary']) || isset($_GET['summaryRaw']) || !count($_GET))
|
||||
{
|
||||
sendRequestFTL("stats");
|
||||
@@ -230,7 +236,11 @@ if(isset($_GET["recentBlocked"]))
|
||||
unset($data);
|
||||
}
|
||||
|
||||
if(isset($data))
|
||||
if(isset($_GET["jsonForceObject"]))
|
||||
{
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user