[Web] Fix mail validation for quota sender address
This commit is contained in:
parent
ebf292531d
commit
6efe8b7bde
@ -1,4 +1,8 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
function validateEmail(email) {
|
||||||
|
var re = /^(([^<>()[\]\\.,;:\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,}))$/;
|
||||||
|
return re.test(email);
|
||||||
|
}
|
||||||
function is_active(elem) {
|
function is_active(elem) {
|
||||||
if ($(elem).data('submitted') == '1') {
|
if ($(elem).data('submitted') == '1') {
|
||||||
return true;
|
return true;
|
||||||
@ -100,8 +104,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($(this).attr("type") == 'email') {
|
if ($(this).attr("type") == 'email') {
|
||||||
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
|
if (!validateEmail($(this).val())) {
|
||||||
if (!emailReg.test($(this).val())) {
|
|
||||||
invalid = true;
|
invalid = true;
|
||||||
$(this).addClass('inputMissingAttr');
|
$(this).addClass('inputMissingAttr');
|
||||||
} else {
|
} else {
|
||||||
|
@ -188,10 +188,6 @@ jQuery(function($){
|
|||||||
var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};
|
var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};
|
||||||
function escapeHtml(n){return String(n).replace(/[&<>"'`=\/]/g,function(n){return entityMap[n]})}
|
function escapeHtml(n){return String(n).replace(/[&<>"'`=\/]/g,function(n){return entityMap[n]})}
|
||||||
// http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
|
// http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
|
||||||
function validateEmail(email) {
|
|
||||||
var re = /^(([^<>()[\]\\.,;:\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,}))$/;
|
|
||||||
return re.test(email);
|
|
||||||
}
|
|
||||||
function humanFileSize(i){if(Math.abs(i)<1024)return i+" B";var B=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],e=-1;do{i/=1024,++e}while(Math.abs(i)>=1024&&e<B.length-1);return i.toFixed(1)+" "+B[e]}
|
function humanFileSize(i){if(Math.abs(i)<1024)return i+" B";var B=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],e=-1;do{i/=1024,++e}while(Math.abs(i)>=1024&&e<B.length-1);return i.toFixed(1)+" "+B[e]}
|
||||||
$(".refresh_table").on('click', function(e) {
|
$(".refresh_table").on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user