mirror of
https://github.com/pi-hole/web.git
synced 2026-04-27 12:15:00 +01:00
Use formmated string for "api.php?summary" (#2067)
restoring the old behavior Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
This commit is contained in:
15
api_FTL.php
15
api_FTL.php
@@ -39,12 +39,23 @@ else
|
||||
$tmp = explode(" ",$line);
|
||||
|
||||
if($tmp[0] === "domains_being_blocked" && !is_numeric($tmp[1])) {
|
||||
$stats[$tmp[0]] = $tmp[1]; // Expect string response
|
||||
// Expect string response
|
||||
$stats[$tmp[0]] = $tmp[1];
|
||||
} elseif ($tmp[0] === "status") {
|
||||
// Expect string response
|
||||
$stats[$tmp[0]] = piholeStatusAPI();
|
||||
} elseif (isset($_GET['summary'])) {
|
||||
// "summary" expects a formmated string response
|
||||
if($tmp[0] !== "ads_percentage_today") {
|
||||
$stats[$tmp[0]] = number_format($tmp[1]);
|
||||
} else {
|
||||
$stats[$tmp[0]] = number_format($tmp[1], 1, '.', '');
|
||||
}
|
||||
} else {
|
||||
$stats[$tmp[0]] = floatval($tmp[1]); // Expect float response
|
||||
// Expect float response
|
||||
$stats[$tmp[0]] = floatval($tmp[1]);
|
||||
}
|
||||
|
||||
}
|
||||
$stats['gravity_last_updated'] = gravity_last_update(true);
|
||||
$data = array_merge($data,$stats);
|
||||
|
||||
Reference in New Issue
Block a user