@@ -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(); |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | { |
105 | 105 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
106 | 106 | $result = Requests::post($url); |
107 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
107 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
108 | 108 | { |
109 | 109 | return "0 results"; |
110 | 110 | } |
111 | 111 | else |
112 | 112 | { |
113 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
114 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
115 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
113 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
114 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
115 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
116 | 116 | |
117 | 117 | $location = new Location(); |
118 | 118 | $location->setLat($lat); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | lng='" . $lng . "' |
135 | 135 | WHERE access_token='" . $this->accessToken . "'"); |
136 | 136 | |
137 | - if($result === false) |
|
137 | + if($result === FALSE) |
|
138 | 138 | { |
139 | 139 | echo "Updating location failed: (" . $db->errno . ") " . $db->error; |
140 | 140 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | else |
242 | 242 | { |
243 | 243 | error_log('Could not vote - Error: ' . $data['status_code']); |
244 | - error_log('Could not vote: ' . print_r($data, true)); |
|
244 | + error_log('Could not vote: ' . print_r($data, TRUE)); |
|
245 | 245 | return FALSE; |
246 | 246 | } |
247 | 247 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | |
306 | 306 | if($data != 'Success') |
307 | 307 | { |
308 | - error_log(print_r($data, true)); |
|
308 | + error_log(print_r($data, TRUE)); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | $accountCreator->location = $this->location; |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | expiration_date='" . $expiration_date . "' |
370 | 370 | WHERE device_uid='" . $device_uid . "'"); |
371 | 371 | |
372 | - if($result === false){ |
|
372 | + if($result === FALSE){ |
|
373 | 373 | error_log("Adding account failed: (" . $db->errno . ") " . $db->error); |
374 | 374 | } |
375 | 375 | } |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')"); |
419 | 419 | |
420 | - if($result === false) |
|
420 | + if($result === FALSE) |
|
421 | 421 | { |
422 | 422 | $error = db_error(); |
423 | 423 | echo $error; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
450 | 450 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
451 | 451 | |
452 | - if($result === false){ |
|
452 | + if($result === FALSE){ |
|
453 | 453 | $error = db_error(); |
454 | 454 | echo $error; |
455 | 455 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
482 | 482 | |
483 | 483 | $success = TRUE; |
484 | - if($result === false){ |
|
484 | + if($result === FALSE){ |
|
485 | 485 | $error = db_error(); |
486 | 486 | echo $error; |
487 | 487 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |