Fix Address::parseFTN when matching addresses with 0's, minor cosmetic fixes, test subjects < 72 chars

This commit is contained in:
Deon George
2021-07-01 21:56:55 +10:00
parent 16a1d8a440
commit 88d189110d
4 changed files with 5 additions and 5 deletions

View File

@@ -130,11 +130,11 @@ class Address extends Model
// Check our numbers are correct.
foreach ([1,2,3] as $i) {
if (! $matches[$i] || ($matches[$i] > DomainController::NUMBER_MAX))
if ((! is_numeric($matches[$i])) || ($matches[$i] > DomainController::NUMBER_MAX))
throw new Exception('Invalid FTN: '.$ftn);
}
if (isset($matches[5]) AND $matches[5] > DomainController::NUMBER_MAX)
if (isset($matches[5]) AND ((! is_numeric($matches[$i])) || ($matches[5] > DomainController::NUMBER_MAX)))
throw new Exception('Invalid FTN: '.$ftn);
return [