diff --git a/app/voicemails/resources/classes/voicemail.php b/app/voicemails/resources/classes/voicemail.php
index bef26980f9..977123e628 100644
--- a/app/voicemails/resources/classes/voicemail.php
+++ b/app/voicemails/resources/classes/voicemail.php
@@ -291,7 +291,7 @@
//filter out unchecked sip profiles
foreach ($records as $x => $record) {
- if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
+ if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
@@ -411,7 +411,7 @@
//filter out unchecked sip profiles
foreach ($records as $x => $record) {
- if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
+ if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
//build the delete array
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
$array[$this->table][$x]['voicemail_uuid'] = $this->voicemail_uuid;
@@ -458,7 +458,7 @@
//filter out unchecked sip profiles
foreach ($records as $x => $record) {
- if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
+ if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
//build the delete array
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
$array[$this->table][$x]['voicemail_uuid'] = $this->voicemail_uuid;
@@ -507,7 +507,7 @@
//filter out unchecked sip profiles
foreach ($records as $x => $record) {
- if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
+ if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
@@ -748,7 +748,7 @@
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$_SESSION['domain_name'].'/'.$this->voicemail_id;
//prepare base64 content from db, if enabled
- if ($_SESSION['voicemail']['storage_type']['text'] == 'base64') {
+ if (!empty($_SESSION['voicemail']['storage_type']['text']) && $_SESSION['voicemail']['storage_type']['text'] == 'base64') {
$sql = "select message_base64 ";
$sql .= "from ";
$sql .= "v_voicemail_messages as m, ";
@@ -799,11 +799,6 @@
return false;
}
- //content-range
- if (isset($_SERVER['HTTP_RANGE']) && $this->type != 'bin') {
- $this->range_download($file_path);
- }
-
$fd = fopen($file_path, "rb");
if ($this->type == 'bin') {
header("Content-Type: application/force-download");
@@ -830,10 +825,16 @@
header("Content-Length: ".filesize($file_path));
}
ob_end_clean();
+
+ //content-range
+ if (isset($_SERVER['HTTP_RANGE']) && $this->type != 'bin') {
+ $this->range_download($file_path);
+ }
+
fpassthru($fd);
//if base64, remove temp file
- if ($_SESSION['voicemail']['storage_type']['text'] == 'base64') {
+ if (!empty($_SESSION['voicemail']['storage_type']['text']) && $_SESSION['voicemail']['storage_type']['text'] == 'base64') {
@unlink($path.'/msg_'.$this->voicemail_message_uuid.'.'.$file_ext);
}
@@ -884,7 +885,7 @@
// If the range starts with an '-' we start from the beginning
// If not, we forward the file pointer
// And make sure to get the end byte if spesified
- if ($range0 == '-') {
+ if (!empty($range0) && $range0 == '-') {
// The n-number of the last bytes is requested
$c_start = $size - substr($range, 1);
}
diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php
index 8a01522499..4206425ca5 100644
--- a/app/voicemails/resources/dashboard/voicemails.php
+++ b/app/voicemails/resources/dashboard/voicemails.php
@@ -120,7 +120,7 @@
if (is_uuid($voicemail_uuid)) {
$tr_link = "href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php?id=".(permission_exists('voicemail_view') ? $voicemail_uuid : $row['ext'])."'";
echo "
";
- echo " | ".$row['ext']." | ";
+ echo " ".$row['ext']." | ";
echo " ".$row['new']." | ";
echo " ".$row['total']." | ";
echo "
";
diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php
index c5301cada3..63393e24b4 100644
--- a/app/voicemails/voicemail_edit.php
+++ b/app/voicemails/voicemail_edit.php
@@ -74,7 +74,7 @@
if (!empty($_POST)) {
//process the http post data by submitted action
- if ($_POST['action'] != '' && is_uuid($_POST['voicemail_uuid'])) {
+ if (!empty($_POST['action']) && is_uuid($_POST['voicemail_uuid'])) {
$array[0]['checked'] = 'true';
$array[0]['uuid'] = $_POST['voicemail_uuid'];
@@ -98,16 +98,16 @@
$voicemail_options = $_POST["voicemail_options"];
$voicemail_alternate_greet_id = $_POST["voicemail_alternate_greet_id"];
$voicemail_mail_to = $_POST["voicemail_mail_to"];
- $voicemail_sms_to = $_POST["voicemail_sms_to"];
- $voicemail_transcription_enabled = $_POST["voicemail_transcription_enabled"];
+ $voicemail_sms_to = $_POST["voicemail_sms_to"] ?? null;
+ $voicemail_transcription_enabled = $_POST["voicemail_transcription_enabled"] ?? null;
$voicemail_file = $_POST["voicemail_file"];
$voicemail_local_after_email = $_POST["voicemail_local_after_email"];
$voicemail_destination = $_POST["voicemail_destination"];
$voicemail_enabled = $_POST["voicemail_enabled"] ?? 'false';
$voicemail_description = $_POST["voicemail_description"];
$voicemail_tutorial = $_POST["voicemail_tutorial"];
- $voicemail_options_delete = $_POST["voicemail_options_delete"];
- $voicemail_destinations_delete = $_POST["voicemail_destinations_delete"];
+ $voicemail_options_delete = $_POST["voicemail_options_delete"] ?? null;
+ $voicemail_destinations_delete = $_POST["voicemail_destinations_delete"] ?? null;
//remove the space
$voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to);
@@ -211,7 +211,7 @@
$array['voicemail_options'][$x]['voicemail_option_order'] = $voicemail_option['voicemail_option_order'];
$array['voicemail_options'][$x]['voicemail_option_description'] = $voicemail_option['voicemail_option_description'];
}
- if (is_array($array['voicemail_options']) && @sizeof($array['voicemail_options']) != 0) {
+ if (!empty($array['voicemail_options']) && is_array($array['voicemail_options']) && @sizeof($array['voicemail_options']) != 0) {
//grant temporary permission
$p->add('voicemail_option_add', 'temp');
}
@@ -540,7 +540,7 @@
echo "\n";
echo " | \n";
echo " \n";
echo " | \n";
}