X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0de83c4a5188878742ad081c3acdc0e5d98a7c00..4be6970bd437db93e90bc46c2b5a0ddf14be1e5b:/lib-php/TokenPostcode.php?ds=sidebyside diff --git a/lib-php/TokenPostcode.php b/lib-php/TokenPostcode.php index f0dbd457..0ff92929 100644 --- a/lib-php/TokenPostcode.php +++ b/lib-php/TokenPostcode.php @@ -25,7 +25,12 @@ class Postcode public function __construct($iId, $sPostcode, $sCountryCode = '') { $this->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; }