@@ -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 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | else |
| 237 | 237 | { |
| 238 | - error_log("Could not vote: " . print_r($data, true)); |
|
| 238 | + error_log("Could not vote: " . print_r($data, TRUE)); |
|
| 239 | 239 | return FALSE; |
| 240 | 240 | } |
| 241 | 241 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | |
| 297 | 297 | if($data != 'Success') |
| 298 | 298 | { |
| 299 | - error_log(print_r($data, true)); |
|
| 299 | + error_log(print_r($data, TRUE)); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | $accountCreator->location = $this->location; |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | expiration_date='" . $expiration_date . "' |
| 361 | 361 | WHERE device_uid='" . $device_uid . "'"); |
| 362 | 362 | |
| 363 | - if($result === false){ |
|
| 363 | + if($result === FALSE){ |
|
| 364 | 364 | error_log("Adding account failed: (" . $db->errno . ") " . $db->error); |
| 365 | 365 | } |
| 366 | 366 | } |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')"); |
| 410 | 410 | |
| 411 | - if($result === false) |
|
| 411 | + if($result === FALSE) |
|
| 412 | 412 | { |
| 413 | 413 | $error = db_error(); |
| 414 | 414 | echo $error; |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 441 | 441 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
| 442 | 442 | |
| 443 | - if($result === false){ |
|
| 443 | + if($result === FALSE){ |
|
| 444 | 444 | $error = db_error(); |
| 445 | 445 | echo $error; |
| 446 | 446 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 473 | 473 | |
| 474 | 474 | $success = TRUE; |
| 475 | - if($result === false){ |
|
| 475 | + if($result === FALSE){ |
|
| 476 | 476 | $error = db_error(); |
| 477 | 477 | echo $error; |
| 478 | 478 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |