@@ -58,15 +58,15 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
| 60 | 60 | $result = Requests::post($url); |
| 61 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
| 61 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
| 62 | 62 | { |
| 63 | 63 | return "0 results"; |
| 64 | 64 | } |
| 65 | 65 | else |
| 66 | 66 | { |
| 67 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
| 68 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
| 69 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
| 67 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
| 68 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
| 69 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
| 70 | 70 | |
| 71 | 71 | $location = new Location(); |
| 72 | 72 | $location->setLat($lat); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | lng='" . $lng . "' |
| 89 | 89 | WHERE access_token='" . $this->accessToken . "'"); |
| 90 | 90 | |
| 91 | - if($result === false) |
|
| 91 | + if($result === FALSE) |
|
| 92 | 92 | { |
| 93 | 93 | echo "Updating location failed: (" . $db->errno . ") " . $db->error; |
| 94 | 94 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | expiration_date='" . $expiration_date . "' |
| 304 | 304 | WHERE device_uid='" . $device_uid . "'"); |
| 305 | 305 | |
| 306 | - if($result === false){ |
|
| 306 | + if($result === FALSE){ |
|
| 307 | 307 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
| 308 | 308 | } |
| 309 | 309 | } |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')"); |
| 361 | 361 | |
| 362 | - if($result === false) |
|
| 362 | + if($result === FALSE) |
|
| 363 | 363 | { |
| 364 | 364 | $error = db_error(); |
| 365 | 365 | echo $error; |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 392 | 392 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
| 393 | 393 | |
| 394 | - if($result === false){ |
|
| 394 | + if($result === FALSE){ |
|
| 395 | 395 | $error = db_error(); |
| 396 | 396 | echo $error; |
| 397 | 397 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 424 | 424 | |
| 425 | 425 | $success = TRUE; |
| 426 | - if($result === false){ |
|
| 426 | + if($result === FALSE){ |
|
| 427 | 427 | $error = db_error(); |
| 428 | 428 | echo $error; |
| 429 | 429 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |