Skip to content

Commit

Permalink
Limit contact.contact_address to 255 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Jul 3, 2024
1 parent 35ecfa7 commit f55041b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion library/Notifications/Web/Form/ContactForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ private function addAddressElements(): void
$this->addElement($address);

foreach ($plugins as $type => $label) {
$element = $this->createElement('text', $type, ['label' => $label]);
$element = $this->createElement('text', $type, [
'label' => $label,
'validators' => [new StringLengthValidator(['max' => 255])]
]);

if ($type === 'email') {
$element->addAttributes(['validators' => [new EmailAddressValidator()]]);
}
Expand Down

0 comments on commit f55041b

Please sign in to comment.