allow mail address with name part for password reset FROM address

This commit is contained in:
Roland Gruber 2011-05-17 16:02:31 +00:00
parent 09866a9384
commit e59023b1a9
2 changed files with 4 additions and 1 deletions

View File

@ -413,6 +413,9 @@ function get_preg($argument, $regexp) {
case "email":
$pregexpr = '/^([0-9a-zA-Z+\\/\\._-])+[@]([0-9a-zA-Z-])+([.]([0-9a-zA-Z-])+)*$/';
break;
case "emailWithName":
$pregexpr = '/^([[:alnum:] ])+ <([0-9a-zA-Z+\\/\\._-])+[@]([0-9a-zA-Z-])+([.]([0-9a-zA-Z-])+)*>$/u';
break;
case "mailLocalAddress":
$pregexpr = '/^([0-9a-zA-Z+\\/\\._-])+([@]([0-9a-zA-Z-])+([.]([0-9a-zA-Z-])+)*)?$/';
break;

View File

@ -1048,7 +1048,7 @@ class LAMConfig {
*/
public function setLamProMailFrom($lamProMailFrom) {
$this->lamProMailFrom = $lamProMailFrom;
if (($lamProMailFrom != '') && !get_preg($lamProMailFrom, 'email')) {
if (($lamProMailFrom != '') && !get_preg($lamProMailFrom, 'email') && !get_preg($lamProMailFrom, 'emailWithName')) {
return false;
}
return true;