mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
mvc: HostnameField validation message
This commit is contained in:
parent
7fab0249f7
commit
b3005955c1
@ -41,11 +41,6 @@ class HostnameField extends BaseField
|
||||
*/
|
||||
protected $internalIsContainer = false;
|
||||
|
||||
/**
|
||||
* @var string default validation message string
|
||||
*/
|
||||
protected $internalValidationMessage = "please specify a valid address (IPv4/IPv6) or hostname";
|
||||
|
||||
/**
|
||||
* @var null when multiple values could be provided at once, specify the split character
|
||||
*/
|
||||
@ -158,6 +153,14 @@ class HostnameField extends BaseField
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function defaultValidationMessage()
|
||||
{
|
||||
return gettext('Please specify a valid IP address or hostname.');
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieve field validators for this field type
|
||||
* @return array returns Text/regex validator
|
||||
@ -166,14 +169,14 @@ class HostnameField extends BaseField
|
||||
{
|
||||
$validators = parent::getValidators();
|
||||
if ($this->internalValue != null) {
|
||||
$validators[] = new HostValidator(array(
|
||||
'message' => $this->internalValidationMessage,
|
||||
$validators[] = new HostValidator([
|
||||
'message' => $this->getValidationMessage(),
|
||||
'split' => $this->internalFieldSeparator,
|
||||
'allowip' => $this->internalIpAllowed,
|
||||
'hostwildcard' => $this->internalHostWildcardAllowed,
|
||||
'fqdnwildcard' => $this->internalFqdnWildcardAllowed,
|
||||
'zoneroot' => $this->internalZoneRootAllowed
|
||||
));
|
||||
'zoneroot' => $this->internalZoneRootAllowed,
|
||||
]);
|
||||
}
|
||||
return $validators;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user