From d272fc9b09ff6b66b629c9be9c7b2c45b4c8e6a6 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Wed, 15 Feb 2023 08:33:59 -0500 Subject: [PATCH] Updates to InputfieldEmail that were supposed to be in the previous commit --- wire/modules/Inputfield/InputfieldEmail.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/modules/Inputfield/InputfieldEmail.module b/wire/modules/Inputfield/InputfieldEmail.module index 84977e13..e1c947d3 100644 --- a/wire/modules/Inputfield/InputfieldEmail.module +++ b/wire/modules/Inputfield/InputfieldEmail.module @@ -57,6 +57,7 @@ class InputfieldEmail extends InputfieldText { $attrs = $this->getAttributes(); if((int) $this->allowIDN > 1) { // UTF-8 emails are not supported by HTML5 email input type at least in current Chrome + $attrs['pattern'] = '[^@]+@[^\.]+\...+'; $attrs['type'] = 'text'; } @@ -188,10 +189,9 @@ class InputfieldEmail extends InputfieldText { * */ protected function sanitizeEmail($email) { - $email2 = $this->wire()->sanitizer->email($email, array( + return $this->wire()->sanitizer->email($email, array( 'allowIDN' => (int) $this->allowIDN, )); - return $email2; } /**