X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/73953cbac95847740339d7a5ee3c0e5f142d93c5..f289db9bfe21c5a725e751be98e2b824026e2310:/lib-php/TokenPostcode.php diff --git a/lib-php/TokenPostcode.php b/lib-php/TokenPostcode.php index c0b42fad..0ff92929 100644 --- a/lib-php/TokenPostcode.php +++ b/lib-php/TokenPostcode.php @@ -1,4 +1,12 @@ iId = $iId; - $this->sPostcode = $sPostcode; + $iSplitPos = strpos($sPostcode, '@'); + if ($iSplitPos === false) { + $this->sPostcode = $sPostcode; + } else { + $this->sPostcode = substr($sPostcode, 0, $iSplitPos); + } $this->sCountryCode = empty($sCountryCode) ? '' : $sCountryCode; }