mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
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 commit0908f42cc7. See commitecf490ff79for the proper fix.
This commit is contained in:
@@ -346,6 +346,11 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||
$fax_name = str_replace("+", "_", $fax_name);
|
||||
$fax_name = str_replace("=", "_", $fax_name);
|
||||
|
||||
|
||||
$attachment_file_name = $_files['name'][$index];
|
||||
rename($dir_fax_temp.'/'.$attachment_file_name, $dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension);
|
||||
unset($attachment_file_name);
|
||||
|
||||
if (!$included) {
|
||||
//move uploaded file
|
||||
move_uploaded_file($_files['tmp_name'][$index], $dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user