mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-10-05 17:52:03 +02:00
Update email regex to allow:
Nathan Gray <ng.dot@email.com>
This commit is contained in:
parent
536a939e6c
commit
f73f8fea89
@ -21,7 +21,7 @@ class etemplate_widget_url extends etemplate_widget
|
||||
/**
|
||||
* Regexes for validating
|
||||
*/
|
||||
const EMAIL_PREG = '^[^\x00-\x20()<>@,;:\\".\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}';
|
||||
const EMAIL_PREG = '^(?:[ a-z0-9!#$%&\'*+\/=?^_`{|}\(\)~-]+<)?[^\x00-\x20()<>@,;:\"\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}';
|
||||
|
||||
/**
|
||||
* Validate input
|
||||
|
@ -32,7 +32,7 @@ var et2_url = et2_textbox.extend(
|
||||
},
|
||||
|
||||
// PREG for client-side validation copied from etemplate_widget_url
|
||||
EMAIL_PREG: new RegExp(/^[^\x00-\x20()<>@,;:\".\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}/),
|
||||
EMAIL_PREG: new RegExp(/^(?:[ a-z0-9!#$%&'*+/=?^_`{|}\(\)~-]+<)?[^\x00-\x20()<>@,;:\"\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}/i),
|
||||
/**
|
||||
* @memberOf et2_url
|
||||
*/
|
||||
@ -198,7 +198,11 @@ var et2_url = et2_textbox.extend(
|
||||
}
|
||||
break;
|
||||
case "url-email":
|
||||
if(!e.data.EMAIL_PREG.test(value))
|
||||
if(!e.data.EMAIL_PREG.test(value) ||
|
||||
// If they use Text <email>, make sure the <> match
|
||||
(value.indexOf("<") > 0 && value.indexOf(">") != value.length-1) ||
|
||||
(value.indexOf(">") > 0 && value.indexOf("<") < 0)
|
||||
)
|
||||
{
|
||||
e.data.showMessage("Invalid email","validation_error",true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user