From e1ab523a329f690b379fbd3d9b8a329a2beeede1 Mon Sep 17 00:00:00 2001 From: Val Date: Tue, 18 Nov 2025 16:16:37 -0500 Subject: [PATCH] Remove use of `Str::slug` when building reverse geocoding cache key Use of `Str::slug` when building reverse geocoding cache key was redundant as the characters allowed in the cache are already controller. This fixes a bug where geolocation with opposites lat/lngs (45/73 vs -45/73 vs 45/-73 vs -45/-73) would all have the same cache key. --- src/ProviderAndDumperAggregator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProviderAndDumperAggregator.php b/src/ProviderAndDumperAggregator.php index a5c07c9..f8395fe 100644 --- a/src/ProviderAndDumperAggregator.php +++ b/src/ProviderAndDumperAggregator.php @@ -168,7 +168,7 @@ public function registerProvidersFromConfig(Collection $providers) : self public function reverse(float $latitude, float $longitude) : self { - $cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}"))); + $cacheKey = strtolower(urlencode("{$latitude}-{$longitude}")); $this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse"); return $this;