@@ -90,15 +90,15 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
| 92 | 92 | $result = Requests::post($url); |
| 93 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
| 93 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
| 94 | 94 | { |
| 95 | 95 | return "0 results"; |
| 96 | 96 | } |
| 97 | 97 | else |
| 98 | 98 | { |
| 99 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
| 100 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
| 101 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
| 99 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
| 100 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
| 101 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
| 102 | 102 | |
| 103 | 103 | $location = new Location(); |
| 104 | 104 | $location->setLat($lat); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | lng='" . $lng . "' |
| 121 | 121 | WHERE access_token='" . $accessToken . "'"); |
| 122 | 122 | |
| 123 | - if($result === false) |
|
| 123 | + if($result === FALSE) |
|
| 124 | 124 | { |
| 125 | 125 | echo "Updating location failed: (" . $db->errno . ") " . $db->error; |
| 126 | 126 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | expiration_date='" . $expiration_date . "' |
| 293 | 293 | WHERE device_uid='" . $device_uid . "'"); |
| 294 | 294 | |
| 295 | - if($result === false){ |
|
| 295 | + if($result === FALSE){ |
|
| 296 | 296 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
| 297 | 297 | } |
| 298 | 298 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | expiration_date='" . $expiration_date . "' |
| 338 | 338 | WHERE device_uid='" . $device_uid . "'"); |
| 339 | 339 | |
| 340 | - if($result === false){ |
|
| 340 | + if($result === FALSE){ |
|
| 341 | 341 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
| 342 | 342 | } |
| 343 | 343 | } |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | expiration_date='" . $expiration_date . "' |
| 385 | 385 | WHERE device_uid='" . $device_uid . "'"); |
| 386 | 386 | |
| 387 | - if($result === false){ |
|
| 387 | + if($result === FALSE){ |
|
| 388 | 388 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
| 389 | 389 | } |
| 390 | 390 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | FROM votes |
| 509 | 509 | WHERE (postId = '" . $postId . "' AND device_uid = '" . $deviceUid . "')"); |
| 510 | 510 | |
| 511 | - if($result === false) |
|
| 511 | + if($result === FALSE) |
|
| 512 | 512 | { |
| 513 | 513 | $error = db_error(); |
| 514 | 514 | echo $error; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 541 | 541 | VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')"); |
| 542 | 542 | |
| 543 | - if($result === false){ |
|
| 543 | + if($result === FALSE){ |
|
| 544 | 544 | $error = db_error(); |
| 545 | 545 | echo $error; |
| 546 | 546 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 573 | 573 | |
| 574 | 574 | $success = TRUE; |
| 575 | - if($result === false){ |
|
| 575 | + if($result === FALSE){ |
|
| 576 | 576 | $error = db_error(); |
| 577 | 577 | echo $error; |
| 578 | 578 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | { |
| 619 | 619 | preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
| 620 | 620 | |
| 621 | - return (isset($matches[0])) ? true : false; |
|
| 621 | + return (isset($matches[0])) ? TRUE : FALSE; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | function botDeviceUidIsSet($config) |