From 4fde7dfc80de4a5dbf70435fb03a7a9c2fe86ccb Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Thu, 12 Nov 2015 14:00:01 +0300 Subject: [PATCH] Fix. multiple calls fax_send caused error. Fix. require EventSocket implicitly. Fix. require `test` class. --- app/fax/fax_emails.php | 1 + app/fax/fax_send.php | 31 +++++++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/fax/fax_emails.php b/app/fax/fax_emails.php index 906a7eb013..3c615a8e75 100644 --- a/app/fax/fax_emails.php +++ b/app/fax/fax_emails.php @@ -29,6 +29,7 @@ include "root.php"; require_once "resources/require.php"; require_once "resources/functions/object_to_array.php"; require_once "resources/functions/parse_attachments.php"; +require_once "resources/classes/text.php"; //get accounts to monitor $sql = "select * from v_fax "; diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index e134e37bbe..315737f933 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -98,21 +98,28 @@ if (!$included) { $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax'.((count($_SESSION["domains"]) > 1) ? '/'.$_SESSION['domain_name'] : null); } - -function correct_path($p) { - global $IS_WINDOWS; - if ($IS_WINDOWS) { - return str_replace('/', '\\', $p); - } - return $p; +else { + require_once "resources/classes/EventSocket.php"; } -function gs_cmd($args) { - global $IS_WINDOWS; - if ($IS_WINDOWS) { - return 'gswin32c '.$args; +if(!function_exists('correct_path')) { + function correct_path($p) { + global $IS_WINDOWS; + if ($IS_WINDOWS) { + return str_replace('/', '\\', $p); + } + return $p; + } +} + +if(!function_exists('gs_cmd')) { + function gs_cmd($args) { + global $IS_WINDOWS; + if ($IS_WINDOWS) { + return 'gswin32c '.$args; + } + return 'gs '.$args; } - return 'gs '.$args; } //get the fax extension