From d7ab4d30e0cc5831fce74a359ce4cfc9173a55d5 Mon Sep 17 00:00:00 2001 From: Yusur Princeps Date: Tue, 18 Nov 2025 17:06:23 +0100 Subject: [PATCH] 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; }