mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
* Addressbook: switch off client side email address validation as browser rule set seems to be more restrictive than rfc822 rules suggests; implement better rfc822 compliant email address validation
This commit is contained in:
parent
df1a2e20b5
commit
6d05cf328c
@ -21,7 +21,7 @@ class etemplate_widget_url extends etemplate_widget
|
||||
/**
|
||||
* Regexes for validating
|
||||
*/
|
||||
const EMAIL_PREG = '([a-z0-9][a-z0-9._\&\+-]*)?[a-z0-9_]@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}';
|
||||
const EMAIL_PREG = '^[^\x00-\x20()<>@,;:\\".\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}';
|
||||
|
||||
/**
|
||||
* Validate input
|
||||
@ -66,7 +66,7 @@ class etemplate_widget_url extends etemplate_widget
|
||||
}
|
||||
break;
|
||||
case 'url-email':
|
||||
$this->attrs['preg'] = '/^('.self::EMAIL_PREG.')?$/';
|
||||
$this->attrs['preg'] = '/('.self::EMAIL_PREG.')?$/iu';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,8 @@ class url_widget
|
||||
* has to be used case insensitive: /i
|
||||
*/
|
||||
//const EMAIL_PREG = '([a-z0-9][a-z0-9._-]*)?[a-z0-9]@([a-z0-9](|[a-z0-9_-]*[a-z0-9])\.)+[a-z]{2,6}';
|
||||
const EMAIL_PREG = '([a-z0-9][a-z0-9._\&\+-]*)?[a-z0-9_]@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}';
|
||||
//const EMAIL_PREG = '([a-z0-9][a-z0-9._\'\&\+-]*)?[a-z0-9_]@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}';
|
||||
const EMAIL_PREG = '^[^\x00-\x20()<>@,;:\\"\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}';
|
||||
|
||||
/**
|
||||
* pre-processing of the extension
|
||||
@ -100,7 +101,8 @@ class url_widget
|
||||
{
|
||||
$cell['size'] .= '|[^<]+ ?<'.self::EMAIL_PREG.'>';
|
||||
}
|
||||
$cell['size'] .= ')$/i,email';
|
||||
//$cell['size'] .= ')$/iu,email';// ,email causes browser-side validation. browser is more restrictive, so we disable browserside validation
|
||||
$cell['size'] .= ')$/iu';
|
||||
}
|
||||
#_debug_array($cell);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user