Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Admin/js): allow umlaut domains in validator (emailMask)
Browse files Browse the repository at this point in the history
also move some extFixes back to the original class (VTypes)

Change-Id: Ie76caa49b07a58f600703f87c5da42ce658346be
Reviewed-on: http://gerrit.tine20.com/customers/18659
Tested-by: Jenkins CI (http://ci.tine20.com/) <tine20-jenkins@metaways.de>
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
  • Loading branch information
pschuele committed Dec 7, 2020
1 parent 32918bd commit fa12d0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
21 changes: 0 additions & 21 deletions tine20/Tinebase/js/extFixes.js
Expand Up @@ -52,27 +52,6 @@ Ext.apply(Ext.form.HtmlEditor.prototype, {
}()
});

/**
* fix broken ext email validator
*
* @type RegExp
*/
Ext.apply(Ext.form.VTypes, {
// 2011-01-05 replace \w with [^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F] to allow idn's
emailFixed: /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]|-)+\.)*[^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]|-){0,63})\.([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]{2,63}?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,63}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,63})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,63})\]?$)/i,

urlFixed: /(((^https?)|(^ftp)):\/\/(([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]|-)+\.)+[^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]{2,63}(\/([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]|-|%)+(\.[^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]{2,})?)*((([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]|[\-\.\?\\\/+@&#;`~=%!])*)(\.[^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]{2,})?)*\/?)/i,

email: function(v) {
return this.emailFixed.test(v);
},

url: function(v) {
return this.urlFixed.test(v);
}
});


/**
* fix textfield allowBlank validation
* taken from ext, added trim
Expand Down
6 changes: 3 additions & 3 deletions tine20/library/ExtJS/src/widgets/form/VTypes.js
Expand Up @@ -42,8 +42,8 @@ Ext.form.VTypes = function(){
// closure these in so they are only created once.
var alpha = /^[a-zA-Z_]+$/,
alphanum = /^[a-zA-Z0-9_]+$/,
email = /^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,
url = /(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
email = /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:([^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]|-)+\.)*[^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]([^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]|-){0,63})\.([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]{2,63}?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,63}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,63})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,63})\]?$)/i,
url = /(((^https?)|(^ftp)):\/\/(([^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]|-)+\.)+[^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]{2,63}(\/([^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]|-|%)+(\.[^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]{2,})?)*((([^\s,\x00-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x7F]|[\-\.\?\\\/+@&#;`~=%!])*)(\.[^\s,\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]{2,})?)*\/?)/i;

// All these messages and functions are configurable
return {
Expand Down Expand Up @@ -73,7 +73,7 @@ Ext.form.VTypes = function(){
* <tt>/[a-z0-9_\.\-@]/i</tt>
* @type RegExp
*/
'emailMask' : /[a-z0-9_\.\-@]/i,
'emailMask' : /[\p{L}\d_\.\-@]/u,

/**
* The function used to validate URLs
Expand Down

0 comments on commit fa12d0c

Please sign in to comment.