Compare commits

..

2 commits

Author SHA1 Message Date
75abcfb731 0.1.2 2025-11-18 17:10:40 +01:00
d7ab4d30e0 0.1.2 fix UserAgent behavior in absence of a locator 2025-11-18 17:06:23 +01:00
2 changed files with 6 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{
"name": "yusurko/useragent",
"type": "library",
"version": "0.1.1",
"version": "0.1.2",
"license": "Apache-2.0",
"autoload": {
"psr-4": {

View file

@ -194,9 +194,12 @@ 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();
if ($this->locator === false) {
$this->country = Country::outerSpace();
} else {
$this->country = $this->locator->locate($this->getAddr());
}
}
return $this->country;
}