@@ -110,16 +110,16 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=' . $this->getGeocodingToken(); |
| 112 | 112 | $result = Requests::post($url); |
| 113 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
| 113 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
| 114 | 114 | { |
| 115 | 115 | error_log('Error locationEquals'); |
| 116 | 116 | return FALSE; |
| 117 | 117 | } |
| 118 | 118 | else |
| 119 | 119 | { |
| 120 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
| 121 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
| 122 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
| 120 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
| 121 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
| 122 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | $db = new DatabaseConnect(); |
@@ -163,15 +163,15 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=' . $this->getGeocodingToken(); |
| 165 | 165 | $result = Requests::post($url); |
| 166 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
| 166 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
| 167 | 167 | { |
| 168 | 168 | return "0 results"; |
| 169 | 169 | } |
| 170 | 170 | else |
| 171 | 171 | { |
| 172 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
| 173 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
| 174 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
| 172 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
| 173 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
| 174 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
| 175 | 175 | |
| 176 | 176 | $location = new Location(); |
| 177 | 177 | $location->setLat($lat); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | lng='" . $lng . "' |
| 194 | 194 | WHERE access_token='" . $this->accessToken . "'"); |
| 195 | 195 | |
| 196 | - if($result === false) |
|
| 196 | + if($result === FALSE) |
|
| 197 | 197 | { |
| 198 | 198 | echo "Updating location failed: (" . $db->errno . ") " . $db->error; |
| 199 | 199 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $accountCreator->postId = htmlspecialchars($postId); |
| 294 | 294 | $data = $accountCreator->execute(); |
| 295 | 295 | |
| 296 | - user_log('User voted: ' . print_r($data, true)); |
|
| 296 | + user_log('User voted: ' . print_r($data, TRUE)); |
|
| 297 | 297 | |
| 298 | 298 | if(array_key_exists('post', $data)) |
| 299 | 299 | { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | } |
| 307 | 307 | else |
| 308 | 308 | { |
| 309 | - error_log('Could not vote: ' . print_r($data, true)); |
|
| 309 | + error_log('Could not vote: ' . print_r($data, TRUE)); |
|
| 310 | 310 | return FALSE; |
| 311 | 311 | } |
| 312 | 312 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | |
| 372 | 372 | if($data != 'Success') |
| 373 | 373 | { |
| 374 | - error_log('Could not set location befor Post: ' . print_r($data, true)); |
|
| 374 | + error_log('Could not set location befor Post: ' . print_r($data, TRUE)); |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | $accountCreator->location = $this->location; |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | return $errorMsg; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | - user_log('User posted: ' . print_r($data, true)); |
|
| 396 | + user_log('User posted: ' . print_r($data, TRUE)); |
|
| 397 | 397 | |
| 398 | 398 | if(isset($_POST['ancestor'])) |
| 399 | 399 | { |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | expiration_date='" . $expiration_date . "' |
| 452 | 452 | WHERE device_uid='" . $device_uid . "'"); |
| 453 | 453 | |
| 454 | - if($result === false){ |
|
| 454 | + if($result === FALSE){ |
|
| 455 | 455 | error_log("Adding account failed: (" . $db->errno . ") " . $db->error); |
| 456 | 456 | } |
| 457 | 457 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | |
| 500 | 500 | $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')"); |
| 501 | 501 | |
| 502 | - if($result === false) |
|
| 502 | + if($result === FALSE) |
|
| 503 | 503 | { |
| 504 | 504 | $error = db_error(); |
| 505 | 505 | echo $error; |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 532 | 532 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
| 533 | 533 | |
| 534 | - if($result === false){ |
|
| 534 | + if($result === FALSE){ |
|
| 535 | 535 | $error = db_error(); |
| 536 | 536 | echo $error; |
| 537 | 537 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 564 | 564 | |
| 565 | 565 | $success = TRUE; |
| 566 | - if($result === false){ |
|
| 566 | + if($result === FALSE){ |
|
| 567 | 567 | $error = $db->error(); |
| 568 | 568 | echo $error; |
| 569 | 569 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |