@@ -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 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | else |
242 | 242 | { |
243 | - error_log('Could not vote: ' . print_r($data, true)); |
|
243 | + error_log('Could not vote: ' . print_r($data, TRUE)); |
|
244 | 244 | return FALSE; |
245 | 245 | } |
246 | 246 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | if($data != 'Success') |
306 | 306 | { |
307 | - error_log(print_r($data, true)); |
|
307 | + error_log(print_r($data, TRUE)); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | $accountCreator->location = $this->location; |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | expiration_date='" . $expiration_date . "' |
369 | 369 | WHERE device_uid='" . $device_uid . "'"); |
370 | 370 | |
371 | - if($result === false){ |
|
371 | + if($result === FALSE){ |
|
372 | 372 | error_log("Adding account failed: (" . $db->errno . ") " . $db->error); |
373 | 373 | } |
374 | 374 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')"); |
418 | 418 | |
419 | - if($result === false) |
|
419 | + if($result === FALSE) |
|
420 | 420 | { |
421 | 421 | $error = db_error(); |
422 | 422 | echo $error; |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
449 | 449 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
450 | 450 | |
451 | - if($result === false){ |
|
451 | + if($result === FALSE){ |
|
452 | 452 | $error = db_error(); |
453 | 453 | echo $error; |
454 | 454 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
481 | 481 | |
482 | 482 | $success = TRUE; |
483 | - if($result === false){ |
|
483 | + if($result === FALSE){ |
|
484 | 484 | $error = db_error(); |
485 | 485 | echo $error; |
486 | 486 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |