Skip to content

Commit e1ab523

Browse files
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.
1 parent 6c562f9 commit e1ab523

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ProviderAndDumperAggregator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function registerProvidersFromConfig(Collection $providers) : self
168168

169169
public function reverse(float $latitude, float $longitude) : self
170170
{
171-
$cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}")));
171+
$cacheKey = strtolower(urlencode("{$latitude}-{$longitude}"));
172172
$this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse");
173173

174174
return $this;

0 commit comments

Comments
 (0)