Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 0b16b50

Browse files
hubert-derivHubert Koster
andauthored
Hubert / Invalid unicode characters don't get validated in register email input. (#6666)
* expanding regex with unicode filtering. * refactoring code Co-authored-by: Hubert Koster <hubertkoster@Huberts-MacBook-Pro.local>
1 parent 14a7155 commit 0b16b50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/javascript/app/common/form_validation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,14 @@ const Validation = (() => {
159159
// ------------------------------
160160
// ----- Validation Methods -----
161161
// ------------------------------
162+
163+
const validEmail = value => /^(([a-zA-Z0-9][^!@£$%^&*=/?§±~<>(){}[\]\\.,;:\s@"'`]+(\.[^!@£$%^&*=/?§±~<>(){}[\]\\.,;:\s@"'`]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z0-9]+\.)+[a-zA-Z]{2,}))$/.test(value);
162164
const validRequired = (value, options, field) => {
163165
if (value.length) return true;
164166
// else
165167
ValidatorsMap.get().req.message = field.type === 'checkbox' ? localize('Please select the checkbox.') : localize('This field is required.');
166168
return false;
167169
};
168-
const validEmail = value => /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value);
169170
const validPassword = (value, options, field) => {
170171
if (/^(?=.*[a-z])(?=.*[0-9])(?=.*[A-Z])[ -~]*$/.test(value)) {
171172
Password.checkPassword(field.selector, true);

0 commit comments

Comments
 (0)