Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 75abcfb731 | |||
| d7ab4d30e0 | |||
| fb7e378e1f |
3 changed files with 10 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
vendor/
|
||||
composer.lock
|
||||
|
||||
node_modules/
|
||||
__pycache__/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "yusurko/useragent",
|
||||
"type": "library",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.2",
|
||||
"license": "Apache-2.0",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
@ -14,5 +14,7 @@
|
|||
"email": "sakuragasaki46@gmail.com"
|
||||
}
|
||||
],
|
||||
"require": {}
|
||||
"require": {
|
||||
"phpseclib/phpseclib": "^3.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,8 +194,11 @@ a:link, a:visited {color: #39f}
|
|||
public function getCountry() {
|
||||
if ($this->country === null) {
|
||||
if ($this->locator === null) $this->locator = $this->probeLocator();
|
||||
if ($this->locator === false) $this->country = Country::outerSpace();
|
||||
$this->country = $this->locator->locate($this->getAddr());
|
||||
if ($this->locator === false) {
|
||||
$this->country = Country::outerSpace();
|
||||
} else {
|
||||
$this->country = $this->locator->locate($this->getAddr());
|
||||
}
|
||||
}
|
||||
return $this->country;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue