Problem/Motivation

When copying an email address with unicode character U00A0 in an email field on a node, the validation message is triggered. U00A0 is a non-breaking space character.
However, when saving the node, it bypasses validation, and the unicode character is saved in the database.

Steps to reproduce

Create an email field on a node type.
Copy an email string, containing an unicode U00A0 character

Proposed resolution

Don't proceed to the server when the client side validation fails.

Comments

jurgenr created an issue. See original summary.

adityarawat_ln’s picture

Assigned: Unassigned » adityarawat_ln
Status: Active » Needs review
StatusFileSize
new14.23 KB

Hi @jurgenr,

I reproduced the issue and investigated the client-side validation behavior.

The invalid email containing the Unicode U+00A0 (non-breaking space) was correctly detected initially. However, when submitting the form, the client-side validation process was interrupted by a JavaScript exception:

Step attribute on input type time is not supported.

The form contained a type="time" field with a step attribute, which caused the jQuery Validation library to throw an exception during full form validation. Because the validation process was interrupted, the invalid email could bypass client-side validation and be submitted.

I applied a fix to handle the step validation for unsupported input types such as time, preventing the JavaScript exception and allowing the remaining client-side validation to run correctly.

After applying the fix:

Invalid emails containing U+00A0 are prevented from being submitted.
Valid emails submit successfully.
The JavaScript exception no longer occurs.

I have created and attached a patch for review and testing. Please review the patch and let me know your feedback.