From 6733521ac4f4c3c27085d51945fed6a93a7f18bb Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 19 Feb 2014 03:11:42 +0000 Subject: [PATCH] When using multiple email addresses with faxing commas are used between email addresses. The commas must be escaped this change automatically does the escaping so the end user doesn't have to do it. --- app/fax/fax.php | 36 ++++++++++++++++++++---------------- app/fax/fax_edit.php | 6 ++++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/fax/fax.php b/app/fax/fax.php index 7e850b011e..3acd05c897 100644 --- a/app/fax/fax.php +++ b/app/fax/fax.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2014 the Initial Developer. All Rights Reserved. Contributor(s): @@ -141,21 +141,25 @@ require_once "resources/paging.php"; if ($result_count > 0) { foreach($result as $row) { - echo "\n"; - echo " ".$row['fax_name']."\n"; - echo " ".$row['fax_extension']."\n"; - echo " ".$row['fax_email']." \n"; - echo " ".$row['fax_description']." \n"; - echo " \n"; - if (permission_exists('fax_extension_edit')) { - echo " $v_link_label_edit\n"; - } - if (permission_exists('fax_extension_delete')) { - echo " $v_link_label_delete\n"; - } - echo " \n"; - echo "\n"; - if ($c==0) { $c=1; } else { $c=0; } + //remove the backslash + $row['fax_email'] = str_replace("\\", "", $row['fax_email']); + //show the fax extensions + echo "\n"; + echo " ".$row['fax_name']."\n"; + echo " ".$row['fax_extension']."\n"; + echo " ".$row['fax_email']." \n"; + echo " ".$row['fax_description']." \n"; + echo " \n"; + if (permission_exists('fax_extension_edit')) { + echo " $v_link_label_edit\n"; + } + if (permission_exists('fax_extension_delete')) { + echo " $v_link_label_delete\n"; + } + echo " \n"; + echo "\n"; + //alternate the CSS class + if ($c==0) { $c=1; } else { $c=0; } } //end foreach unset($sql, $result, $row_count); } //end if results diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 11d3366297..fcc235a3c2 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -202,6 +202,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { return; } + //escape the commas with a backslash + $fax_email = str_replace(",", "\\,", $fax_email); + //set the $php_bin //if (file_exists(PHP_BINDIR."/php")) { $php_bin = 'php'; } if (substr(strtoupper(PHP_OS), 0, 3) == "WIN") { @@ -513,6 +516,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { unset ($prep_statement); } +//remove the backslash + $fax_email = str_replace("\\", "", $fax_email); + //set the dialplan_uuid if (strlen($dialplan_uuid) == 0) { $dialplan_uuid = uuid();