mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Updates to InputfieldEmail that were supposed to be in the previous commit
This commit is contained in:
@@ -57,6 +57,7 @@ class InputfieldEmail extends InputfieldText {
|
|||||||
$attrs = $this->getAttributes();
|
$attrs = $this->getAttributes();
|
||||||
if((int) $this->allowIDN > 1) {
|
if((int) $this->allowIDN > 1) {
|
||||||
// UTF-8 emails are not supported by HTML5 email input type at least in current Chrome
|
// UTF-8 emails are not supported by HTML5 email input type at least in current Chrome
|
||||||
|
$attrs['pattern'] = '[^@]+@[^\.]+\...+';
|
||||||
$attrs['type'] = 'text';
|
$attrs['type'] = 'text';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,10 +189,9 @@ class InputfieldEmail extends InputfieldText {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected function sanitizeEmail($email) {
|
protected function sanitizeEmail($email) {
|
||||||
$email2 = $this->wire()->sanitizer->email($email, array(
|
return $this->wire()->sanitizer->email($email, array(
|
||||||
'allowIDN' => (int) $this->allowIDN,
|
'allowIDN' => (int) $this->allowIDN,
|
||||||
));
|
));
|
||||||
return $email2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user