Skip to content

Commit

Permalink
Handle registration number size; closes #1722
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Oct 12, 2023
1 parent 5d3a98a commit 64451da
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lib/GaletteAuto/Auto.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,12 +703,30 @@ public function check($post)
}

switch ($prop) {
//string values with special check
case 'registration':
if (mb_strlen($value) <= 10) {
$this->$prop = $value;
} else {
$this->errors[] = str_replace(
array(
'%maxsize',
'%field',
'%cursize'
),
array(
10,
$this->getPropName($prop),
mb_strlen($value)
),
_T("- Maximum size for %field is %maxsize (current %cursize)!")
);
}
break;
//string values, no check
case 'name':
case 'comment':
//string values with special check?
case 'chassis_number':
case 'registration':
$this->$prop = $value;
break;
//dates
Expand Down

0 comments on commit 64451da

Please sign in to comment.