Skip to content

Commit 45f5281

Browse files
authored
Merge pull request #95 from osmhub/master
Update GeoIP.php
2 parents 1b150cc + 1747687 commit 45f5281

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GeoIP.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ public function getLocation($ip = null)
131131
*/
132132
private function find($ip = null)
133133
{
134+
// If IP not set, user remote IP
135+
$ip = $ip ?: $this->remote_ip;
136+
134137
// Check cache for location
135138
if ($this->config('cache', 'none') !== 'none' && $location = $this->getCache()->get($ip)) {
136139
$location->cached = true;
137140

138141
return $location;
139142
}
140143

141-
// If IP not set, user remote IP
142-
$ip = $ip ?: $this->remote_ip;
143-
144144
// Check if the ip is not local or empty
145145
if ($this->isValid($ip)) {
146146
try {

0 commit comments

Comments
 (0)