Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cydrobolt/polr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaoyi Zha <summermontreal@gmail.com>2018-05-24 05:05:22 +0300
committerChaoyi Zha <summermontreal@gmail.com>2018-05-24 05:05:40 +0300
commitf9622d733b554154a39e9a716c5c134da35acba7 (patch)
tree973e31017e989b6fbde51ca8434d1ab8e6fab71c
parent1fb607ba631cf9a6c9eb7ed922bf723d2dfe03f3 (diff)
Default to null for invalid geoip queries #381
-rw-r--r--app/Helpers/StatsHelper.php1
-rw-r--r--config/geoip.php22
2 files changed, 12 insertions, 11 deletions
diff --git a/app/Helpers/StatsHelper.php b/app/Helpers/StatsHelper.php
index d1b4716..af57cce 100644
--- a/app/Helpers/StatsHelper.php
+++ b/app/Helpers/StatsHelper.php
@@ -61,6 +61,7 @@ class StatsHelper {
->select(DB::raw("country AS label, count(*) AS clicks"))
->groupBy('country')
->orderBy('clicks', 'desc')
+ ->whereNotNull('country')
->get();
return $stats;
diff --git a/config/geoip.php b/config/geoip.php
index 7713d0d..8225f0a 100644
--- a/config/geoip.php
+++ b/config/geoip.php
@@ -126,18 +126,18 @@ return [
'default_location' => [
'ip' => '127.0.0.0',
- 'iso_code' => 'US',
- 'country' => 'United States',
- 'city' => 'New Haven',
- 'state' => 'CT',
- 'state_name' => 'Connecticut',
- 'postal_code' => '06510',
- 'lat' => 41.31,
- 'lon' => -72.92,
- 'timezone' => 'America/New_York',
- 'continent' => 'NA',
+ 'iso_code' => null,
+ 'country' => null,
+ 'city' => null,
+ 'state' => null,
+ 'state_name' => null,
+ 'postal_code' => null,
+ 'lat' => 0,
+ 'lon' => 0,
+ 'timezone' => 'UTC',
+ 'continent' => null,
'default' => true,
- 'currency' => 'USD',
+ 'currency' => null,
],
];