From a1a6b3b1aef5d15f712da6e3cab75e16f4edb1a4 Mon Sep 17 00:00:00 2001 From: dorian Date: Thu, 8 Aug 2019 15:27:30 +0200 Subject: [PATCH] minor code cleanup --- api/json.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/json.php b/api/json.php index 796b025..4f50461 100755 --- a/api/json.php +++ b/api/json.php @@ -38,9 +38,10 @@ if (isset($_GET['locId'])) { $ret = $blueweather->processSensorData($sensorData); $data = $ret; if ($ret['status'] !== 200) { - $log = "\n[".date("M,d,Y h:i:s A")."] ret: ".json_encode($ret)." request: ".json_encode($_POST['submitSensorData']); + $log = "\n[".date("M,d,Y h:i:s A")."] ret: ". + json_encode($ret)." request: ".json_encode($_POST['submitSensorData']); //echo $log; - file_put_contents("./error.log" ,$log, FILE_APPEND); + file_put_contents("./error.log", $log, FILE_APPEND); } } elseif (isset($_GET['command'])) { @@ -52,7 +53,9 @@ if (isset($_GET['locId'])) { switch ($request['header']) { case 1000: // user login - if (!isset($request['body']['username']) || !isset($request['body']['password'])) { + if (!isset($request['body']['username']) + || !isset($request['body']['password']) + ) { $data = array("header"=>400); } else { $token = $blueweather->loginUser(