diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php index 69a90200f..037d147b1 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php +++ b/src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php @@ -42,11 +42,6 @@ class CSVListField extends BaseField */ protected $internalIsContainer = false; - /** - * @var string default validation message string - */ - protected $internalValidationMessage = "list validation error"; - /** * item separator * @var string @@ -69,6 +64,15 @@ class CSVListField extends BaseField */ protected $internalMaskPerItem = false; + /** + * {@inheritdoc} + */ + protected function defaultValidationMessage() + { + return gettext('List validation error.'); + + } + /** * set validation mask * @param string $value regexp validation mask @@ -162,12 +166,12 @@ class CSVListField extends BaseField $items = explode($this->separatorchar, $this->internalValue); foreach ($items as $item) { if (!$regex_match($item, $this->internalMask)) { - return ["\"" . $item . "\" is invalid. " . $this->internalValidationMessage]; + return ["\"" . $item . "\" is invalid. " . $this->getValidationMessage()]; } } } else { if (!$regex_match($this->internalValue, $this->internalMask)) { - return [$this->internalValidationMessage]; + return [$this->getValidationMessage()]; } } return [];