From 120f2c4dc69105bde6f5234b31397820309864cd Mon Sep 17 00:00:00 2001 From: leon Date: Wed, 23 Aug 2023 11:28:55 +0800 Subject: [PATCH] fix email validation regex --- Roo/form/VTypes.js | 2 +- roojs-all.js | 2 +- roojs-bootstrap-debug.js | 2 +- roojs-bootstrap.js | 2 +- roojs-debug.js | 2 +- roojs-ui-debug.js | 2 +- roojs-ui.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Roo/form/VTypes.js b/Roo/form/VTypes.js index 71ecef886b..37021c736f 100644 --- a/Roo/form/VTypes.js +++ b/Roo/form/VTypes.js @@ -17,7 +17,7 @@ Roo.form.VTypes = function(){ // closure these in so they are only created once. var alpha = /^[a-zA-Z_]+$/; var alphanum = /^[a-zA-Z0-9_]+$/; - var email = /^([\w]+)(\.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; + var email = /^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; var url = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; var urlWeb = /^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; diff --git a/roojs-all.js b/roojs-all.js index 0a77620f36..f9b7a6d204 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2319,7 +2319,7 @@ if(this.width){this.el.setWidth(this.width);}if(this.height){this.el.setHeight(t Roo.form.FieldSet=function(A){Roo.form.FieldSet.superclass.constructor.call(this,A);};Roo.extend(Roo.form.FieldSet,Roo.form.Layout,{defaultAutoCreate:{tag:'fieldset',cn:{tag:'legend'}},onRender:function(ct,A){Roo.form.FieldSet.superclass.onRender.call(this,ct,A); if(this.legend){this.setLegend(this.legend);}},setLegend:function(A){if(this.rendered){this.el.child('legend').update(A);}}}); // Roo/form/VTypes.js -Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w]+)(\.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;var E=/^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; +Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;var E=/^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; return {email:function(v){return C.test(v);},emailText:'This field should be an e-mail address in the format "user@domain.com"',emailMask:/[a-z0-9_\.\-@]/i,url:function(v){return D.test(v);},urlWeb:function(v){return E.test(v);},urlText:'This field should be a URL in the format "http:/'+'/www.domain.com"',alpha:function(v){return A.test(v); },alphaText:'This field should only contain letters and _',alphaMask:/[a-z_]/i,alphanum:function(v){return B.test(v);},alphanumText:'This field should only contain letters, numbers and _',alphanumMask:/[a-z0-9_]/i};}(); // Roo/form/FCKeditor.js diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 9059d278ff..94ab2d3039 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -12199,7 +12199,7 @@ Roo.form.VTypes = function(){ // closure these in so they are only created once. var alpha = /^[a-zA-Z_]+$/; var alphanum = /^[a-zA-Z0-9_]+$/; - var email = /^([\w]+)(\.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; + var email = /^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; var url = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; var urlWeb = /^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index ccee1390bb..16f8bda18a 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -525,7 +525,7 @@ this.maskEl.right.setLeft(E.right+this.padding);this.maskEl.right.setTop(E.y-thi this.maskEl.left.setSize(0,0).setXY([0,0]);this.maskEl.left.hide();this.maskEl.bottom.setStyle('position','absolute');this.maskEl.bottom.setSize(0,0).setXY([0,0]);this.maskEl.bottom.hide();this.maskEl.right.setStyle('position','absolute');this.maskEl.right.setSize(0,0).setXY([0,0]); this.maskEl.right.hide();this.toolTip.hide();this.toolTip.el.hide();window.onwheel=function(){return true;};if(this.intervalID){window.clearInterval(this.intervalID);this.intervalID=false;}this.isMasked=false;}}}); // Roo/form/VTypes.js -Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w]+)(\.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;var E=/^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; +Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;var E=/^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; return {email:function(v){return C.test(v);},emailText:'This field should be an e-mail address in the format "user@domain.com"',emailMask:/[a-z0-9_\.\-@]/i,url:function(v){return D.test(v);},urlWeb:function(v){return E.test(v);},urlText:'This field should be a URL in the format "http:/'+'/www.domain.com"',alpha:function(v){return A.test(v); },alphaText:'This field should only contain letters and _',alphaMask:/[a-z_]/i,alphanum:function(v){return B.test(v);},alphanumText:'This field should only contain letters, numbers and _',alphanumMask:/[a-z0-9_]/i};}(); // Roo/bootstrap/form/Input.js diff --git a/roojs-debug.js b/roojs-debug.js index a6a7887841..088a9d13aa 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -55979,7 +55979,7 @@ Roo.form.VTypes = function(){ // closure these in so they are only created once. var alpha = /^[a-zA-Z_]+$/; var alphanum = /^[a-zA-Z0-9_]+$/; - var email = /^([\w]+)(\.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; + var email = /^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; var url = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; var urlWeb = /^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 6b133d291b..2c4cd53704 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -31477,7 +31477,7 @@ Roo.form.VTypes = function(){ // closure these in so they are only created once. var alpha = /^[a-zA-Z_]+$/; var alphanum = /^[a-zA-Z0-9_]+$/; - var email = /^([\w]+)(\.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; + var email = /^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/; var url = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; var urlWeb = /^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; diff --git a/roojs-ui.js b/roojs-ui.js index 7f79a57ff6..d39ce17806 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1372,7 +1372,7 @@ if(this.width){this.el.setWidth(this.width);}if(this.height){this.el.setHeight(t Roo.form.FieldSet=function(A){Roo.form.FieldSet.superclass.constructor.call(this,A);};Roo.extend(Roo.form.FieldSet,Roo.form.Layout,{defaultAutoCreate:{tag:'fieldset',cn:{tag:'legend'}},onRender:function(ct,A){Roo.form.FieldSet.superclass.onRender.call(this,ct,A); if(this.legend){this.setLegend(this.legend);}},setLegend:function(A){if(this.rendered){this.el.child('legend').update(A);}}}); // Roo/form/VTypes.js -Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w]+)(\.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;var E=/^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; +Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;var E=/^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; return {email:function(v){return C.test(v);},emailText:'This field should be an e-mail address in the format "user@domain.com"',emailMask:/[a-z0-9_\.\-@]/i,url:function(v){return D.test(v);},urlWeb:function(v){return E.test(v);},urlText:'This field should be a URL in the format "http:/'+'/www.domain.com"',alpha:function(v){return A.test(v); },alphaText:'This field should only contain letters and _',alphaMask:/[a-z_]/i,alphanum:function(v){return B.test(v);},alphanumText:'This field should only contain letters, numbers and _',alphanumMask:/[a-z0-9_]/i};}(); // Roo/form/FCKeditor.js -- 2.39.2