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

* 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 commit is contained in:
hargut
2016-09-20 21:11:13 -06:00
committed by FusionPBX
parent 5d9720c983
commit 760c44b7b0
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
}