Skip to content

Commit

Permalink
Checks for IP in override array before assignment
Browse files Browse the repository at this point in the history
Checks for IP address in override array (introduced in buonzz@0944809) before attempting assignment which should fix buonzz#9 and buonzz#7
  • Loading branch information
avitalp committed Jun 3, 2015
1 parent 0944809 commit 55bb8aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Buonzz/GeoIP/GeoIP.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public function __construct(){

// Check if an override for the current ip exists
$overrides = \Config::get('laravel-4-freegeoip::overrides');
if(isset($this->ip, $overrides))$this->ip = $overrides[$this->ip];

if (isset($this->ip, $overrides) && in_array($this->ip, $overrides))
$this->ip = $overrides[$this->ip];
}

/**
Expand Down

0 comments on commit 55bb8aa

Please sign in to comment.