API client class v1.1.34

- added spaces throughout Client.php following PSR-2 guidelines
- changed checks to prevent 0 (zero) values from being submitted to the API for routes where this can have negative side effects
This commit is contained in:
malle-pietje 2018-10-10 10:14:00 +02:00
parent 7c6cd4eb85
commit cd92192cb8

View File

@ -212,15 +212,15 @@ class Client
/**
* if we have received values for up/down/MBytes/ap_mac we append them to the payload array to be submitted
*/
if (isset($up)) {
if (!empty($up)) {
$json['up'] = intval($up);
}
if (isset($down)) {
if (!empty($down)) {
$json['down'] = intval($down);
}
if (isset($MBytes)) {
if (!empty($MBytes)) {
$json['bytes'] = intval($MBytes);
}
@ -1907,15 +1907,15 @@ class Client
$json['note'] = trim($note);
}
if (isset($up)) {
if (!empty($up)) {
$json['up'] = intval($up);
}
if (isset($down)) {
if (!empty($down)) {
$json['down'] = intval($down);
}
if (isset($MBytes)) {
if (!empty($MBytes)) {
$json['bytes'] = intval($MBytes);
}