adapt search algorithm to new postcode format in word

This commit is contained in:
Sarah Hoffmann
2022-06-22 09:54:47 +02:00
parent 612d34930b
commit 6eb9044353
4 changed files with 111 additions and 25 deletions

View File

@@ -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;
}