Skip to content

Commit

Permalink
Default to null for invalid geoip queries #381
Browse files Browse the repository at this point in the history
  • Loading branch information
cydrobolt committed May 24, 2018
1 parent 1fb607b commit f9622d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/Helpers/StatsHelper.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function getCountryStats() {
->select(DB::raw("country AS label, count(*) AS clicks")) ->select(DB::raw("country AS label, count(*) AS clicks"))
->groupBy('country') ->groupBy('country')
->orderBy('clicks', 'desc') ->orderBy('clicks', 'desc')
->whereNotNull('country')
->get(); ->get();


return $stats; return $stats;
Expand Down
22 changes: 11 additions & 11 deletions config/geoip.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -126,18 +126,18 @@


'default_location' => [ 'default_location' => [
'ip' => '127.0.0.0', 'ip' => '127.0.0.0',
'iso_code' => 'US', 'iso_code' => null,
'country' => 'United States', 'country' => null,
'city' => 'New Haven', 'city' => null,
'state' => 'CT', 'state' => null,
'state_name' => 'Connecticut', 'state_name' => null,
'postal_code' => '06510', 'postal_code' => null,
'lat' => 41.31, 'lat' => 0,
'lon' => -72.92, 'lon' => 0,
'timezone' => 'America/New_York', 'timezone' => 'UTC',
'continent' => 'NA', 'continent' => null,
'default' => true, 'default' => true,
'currency' => 'USD', 'currency' => null,
], ],


]; ];

0 comments on commit f9622d7

Please sign in to comment.