From d7ab4d30e0cc5831fce74a359ce4cfc9173a55d5 Mon Sep 17 00:00:00 2001 From: Yusur Princeps Date: Tue, 18 Nov 2025 17:06:23 +0100 Subject: [PATCH 1/2] 0.1.2 fix UserAgent behavior in absence of a locator --- src/UserAgent.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/UserAgent.php b/src/UserAgent.php index 7fbf1dd..93321b1 100644 --- a/src/UserAgent.php +++ b/src/UserAgent.php @@ -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; } From 75abcfb73113225fc48caa8ceacf9639c859de8a Mon Sep 17 00:00:00 2001 From: Yusur Princeps Date: Tue, 18 Nov 2025 17:10:40 +0100 Subject: [PATCH 2/2] 0.1.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a69aed8..66ecf73 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "yusurko/useragent", "type": "library", - "version": "0.1.1", + "version": "0.1.2", "license": "Apache-2.0", "autoload": { "psr-4": {