@@ -71,15 +71,15 @@ discard block |
||
71 | 71 | { |
72 | 72 | $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w'; |
73 | 73 | $result = Requests::post($url); |
74 | - if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST') |
|
74 | + if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST') |
|
75 | 75 | { |
76 | 76 | return "0 results"; |
77 | 77 | } |
78 | 78 | else |
79 | 79 | { |
80 | - $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name']; |
|
81 | - $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat']; |
|
82 | - $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng']; |
|
80 | + $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name']; |
|
81 | + $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat']; |
|
82 | + $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng']; |
|
83 | 83 | |
84 | 84 | $location = new Location(); |
85 | 85 | $location->setLat($lat); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | lng='" . $lng . "' |
102 | 102 | WHERE access_token='" . $accessToken . "'"); |
103 | 103 | |
104 | - if($result === false) |
|
104 | + if($result === FALSE) |
|
105 | 105 | { |
106 | 106 | echo "Updating location failed: (" . $db->errno . ") " . $db->error; |
107 | 107 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | expiration_date='" . $expiration_date . "' |
273 | 273 | WHERE device_uid='" . $device_uid . "'"); |
274 | 274 | |
275 | - if($result === false){ |
|
275 | + if($result === FALSE){ |
|
276 | 276 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
277 | 277 | } |
278 | 278 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | expiration_date='" . $expiration_date . "' |
318 | 318 | WHERE device_uid='" . $device_uid . "'"); |
319 | 319 | |
320 | - if($result === false){ |
|
320 | + if($result === FALSE){ |
|
321 | 321 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
322 | 322 | } |
323 | 323 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | expiration_date='" . $expiration_date . "' |
365 | 365 | WHERE device_uid='" . $device_uid . "'"); |
366 | 366 | |
367 | - if($result === false){ |
|
367 | + if($result === FALSE){ |
|
368 | 368 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
369 | 369 | } |
370 | 370 | } |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | FROM votes |
489 | 489 | WHERE (postId = '" . $postId . "' AND device_uid = '" . $deviceUid . "')"); |
490 | 490 | |
491 | - if($result === false) |
|
491 | + if($result === FALSE) |
|
492 | 492 | { |
493 | 493 | $error = db_error(); |
494 | 494 | echo $error; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
521 | 521 | VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')"); |
522 | 522 | |
523 | - if($result === false){ |
|
523 | + if($result === FALSE){ |
|
524 | 524 | $error = db_error(); |
525 | 525 | echo $error; |
526 | 526 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
553 | 553 | |
554 | 554 | $success = TRUE; |
555 | - if($result === false){ |
|
555 | + if($result === FALSE){ |
|
556 | 556 | $error = db_error(); |
557 | 557 | echo $error; |
558 | 558 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | { |
599 | 599 | preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
600 | 600 | |
601 | - return (isset($matches[0])) ? true : false; |
|
601 | + return (isset($matches[0])) ? TRUE : FALSE; |
|
602 | 602 | } |
603 | 603 | |
604 | 604 | function botDeviceUidIsSet($config) |