Fix e-mail attachment handling / conversion & allow local emails to be valid (#1921)

* Enable local email addresses to be valid. E.g required for local Fax submission.

* Fix filenames & allow spaces in filenames.

* Fix attachment file names.

* Revert "Fix filenames & allow spaces in filenames."

This reverts commit 0908f42cc72e64dfa4fc44d424a7584da757e6be.
See commit ecf490ff79a460477e9e4510d57e4fed7951eca2 for the proper fix.
This commit is contained in:
hargut
2016-09-19 16:54:58 +02:00
committed by FusionPBX
parent 5d1e995e2e
commit 903dabfa6c
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -1101,7 +1101,7 @@ function number_pad($number,$n) {
// validate email address syntax
if(!function_exists('valid_email')) {
function valid_email($email) {
$regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,6}$/';
$regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+(\.[A-z0-9]{2,6})?$/';
if ($email != "" && preg_match($regex, $email) == 1) {
return true; // email address has valid syntax
}