geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.94k stars 517 forks source link

Fix LocalePlugin #1128

Closed jbelien closed 3 years ago

jbelien commented 3 years ago

Previous PR #1125 brought an error in the LocalePlugin.

if (empty($query->getLocale())) {
  $query = $query->withLocale($this->locale);
}

was replaced by

$locale = $query->getLocale();
if (null !== $locale && '' !== $locale) {
  $query = $query->withLocale($this->locale);
}

instead of

$locale = $query->getLocale();
if (null === $locale || '' === $locale) {
  $query = $query->withLocale($this->locale);
}