@@ -51,16 +51,16 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
| 53 | 53 | $result = Requests::post($url); |
| 54 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
| 54 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
| 55 | 55 | { |
| 56 | 56 | error_log('Error locationEquals'); |
| 57 | 57 | return FALSE; |
| 58 | 58 | } |
| 59 | 59 | else |
| 60 | 60 | { |
| 61 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
| 62 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
| 63 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
| 61 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
| 62 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
| 63 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $db = new DatabaseConnect(); |
@@ -105,15 +105,15 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
| 107 | 107 | $result = Requests::post($url); |
| 108 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
| 108 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
| 109 | 109 | { |
| 110 | 110 | return "0 results"; |
| 111 | 111 | } |
| 112 | 112 | else |
| 113 | 113 | { |
| 114 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
| 115 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
| 116 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
| 114 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
| 115 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
| 116 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
| 117 | 117 | |
| 118 | 118 | $location = new Location(); |
| 119 | 119 | $location->setLat($lat); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | lng='" . $lng . "' |
| 136 | 136 | WHERE access_token='" . $this->accessToken . "'"); |
| 137 | 137 | |
| 138 | - if($result === false) |
|
| 138 | + if($result === FALSE) |
|
| 139 | 139 | { |
| 140 | 140 | echo "Updating location failed: (" . $db->errno . ") " . $db->error; |
| 141 | 141 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | expiration_date='" . $expiration_date . "' |
| 356 | 356 | WHERE device_uid='" . $device_uid . "'"); |
| 357 | 357 | |
| 358 | - if($result === false){ |
|
| 358 | + if($result === FALSE){ |
|
| 359 | 359 | error_log("Adding account failed: (" . $db->errno . ") " . $db->error); |
| 360 | 360 | } |
| 361 | 361 | } |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')"); |
| 405 | 405 | |
| 406 | - if($result === false) |
|
| 406 | + if($result === FALSE) |
|
| 407 | 407 | { |
| 408 | 408 | $error = db_error(); |
| 409 | 409 | echo $error; |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 436 | 436 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
| 437 | 437 | |
| 438 | - if($result === false){ |
|
| 438 | + if($result === FALSE){ |
|
| 439 | 439 | $error = db_error(); |
| 440 | 440 | echo $error; |
| 441 | 441 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 468 | 468 | |
| 469 | 469 | $success = TRUE; |
| 470 | - if($result === false){ |
|
| 470 | + if($result === FALSE){ |
|
| 471 | 471 | $error = db_error(); |
| 472 | 472 | echo $error; |
| 473 | 473 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |