From 9beef70b94ecb53c73999159ccc26698da36e9a4 Mon Sep 17 00:00:00 2001 From: frytimo Date: Tue, 2 Jul 2024 12:30:26 -0300 Subject: [PATCH] fix missing class exists check for transcribe engine (#7032) Add a class_exists check to ensure transcribe engine exists before attempting the use of the class. --- app/email_queue/resources/jobs/email_send.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php index 9514b64de7..937d13e255 100644 --- a/app/email_queue/resources/jobs/email_send.php +++ b/app/email_queue/resources/jobs/email_send.php @@ -232,14 +232,14 @@ $transcribe_engine = $settings->get('transcribe', 'engine', ''); //add the transcribe object and get the languages arrays - if (!empty($transcribe_engine)) { + if (!empty($transcribe_engine) && class_exists($transcribe_engine)) { $transcribe = new transcribe($settings); - } - //transcribe the voicemail recording - $transcribe->audio_path = $email_attachment_path; - $transcribe->audio_filename = $email_attachment_name; - $transcribe_message = $transcribe->transcribe(); + //transcribe the voicemail recording + $transcribe->audio_path = $email_attachment_path; + $transcribe->audio_filename = $email_attachment_name; + $transcribe_message = $transcribe->transcribe(); + } echo "transcribe path: ".$email_attachment_path."\n"; echo "transcribe name: ".$email_attachment_name."\n";