diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php
index 7a882e62ee..1846633e16 100644
--- a/app/voicemails/voicemail_messages.php
+++ b/app/voicemails/voicemail_messages.php
@@ -34,10 +34,10 @@
//download the message
if (
- !empty($_REQUEST["action"]) == "download"
- && is_numeric($_REQUEST["id"])
- && is_uuid($_REQUEST["uuid"])
- && is_uuid($_REQUEST["voicemail_uuid"])
+ !empty($_REQUEST["action"]) && $_REQUEST["action"] == "download"
+ && !empty($_REQUEST["id"]) && is_numeric($_REQUEST["id"])
+ && !empty($_REQUEST["uuid"]) && is_uuid($_REQUEST["uuid"])
+ && !empty($_REQUEST["voicemail_uuid"]) && is_uuid($_REQUEST["voicemail_uuid"])
) {
$voicemail = new voicemail;
$voicemail->domain_uuid = $_SESSION['domain_uuid'];
@@ -293,13 +293,16 @@
if (is_array($field['messages']) && @sizeof($field['messages']) > 0) {
foreach ($field['messages'] as $row) {
+ //set voicemail messages as bold if unread and normal font weight if read
+ $bold = (empty($row['message_status'])) ? 'font-weight: bold;' : null;
+ //set the list row url as a variable
+ $list_row_url = "javascript:recording_play('".escape($row['voicemail_message_uuid'])."');";
+
//playback progress bar
echo "
|
\n";
echo " |
\n"; // dummy row to maintain alternating background color
- $bold = ($row['message_status'] && !empty($_REQUEST["uuid"]) != $row['voicemail_message_uuid']) ? 'font-weight: bold;' : null;
- $list_row_url = "javascript:recording_play('".escape($row['voicemail_message_uuid'])."');";
echo "\n";
echo " | \n";
echo " \n";
@@ -313,7 +316,7 @@
echo "";
echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.escape($row['voicemail_message_uuid']),'onclick'=>"recording_play('".escape($row['voicemail_message_uuid'])."');"]);
echo button::create(['type'=>'button','title'=>$text['label-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'link'=>"voicemail_messages.php?action=download&id=".urlencode($row['voicemail_id'])."&voicemail_uuid=".escape($row['voicemail_uuid'])."&uuid=".escape($row['voicemail_message_uuid'])."&t=bin&r=".uuid(),'onclick'=>"$(this).closest('tr').children('td').css('font-weight','normal');"]);
- if (!empty($_SESSION['voicemail']['transcribe_enabled']['boolean']) == 'true' && $row['message_transcription'] != '') {
+ if (!empty($_SESSION['voicemail']['transcribe_enabled']['boolean']) && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true' && $row['message_transcription'] != '') {
echo button::create(['type'=>'button','title'=>$text['label-transcription'],'icon'=>'quote-right','onclick'=>"document.getElementById('transcription_".$row['voicemail_message_uuid']."').style.display = document.getElementById('transcription_".$row['voicemail_message_uuid']."').style.display == 'none' ? 'table-row' : 'none'; this.blur(); return false;"]);
}
echo " | \n";
@@ -322,7 +325,7 @@
echo " ".escape($row['file_size_label'])." | \n";
}
echo "
\n";
- if (!empty($_SESSION['voicemail']['transcribe_enabled']['boolean']) == 'true' && $row['message_transcription'] != '') {
+ if (!empty($_SESSION['voicemail']['transcribe_enabled']['boolean']) && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true' && !empty($row['message_transcription'])) {
echo " |
\n"; // dummy row to maintain same background color for transcription row
echo "\n";
echo " \n";
@@ -353,7 +356,7 @@
echo " ";
//autoplay message
- if (!empty($_REQUEST["action"]) == "autoplay" && is_uuid($_REQUEST["uuid"])) {
+ if (!empty($_REQUEST["action"]) && $_REQUEST["action"] == "autoplay" && !empty($_REQUEST["uuid"]) && is_uuid($_REQUEST["uuid"])) {
echo "";
}
@@ -374,4 +377,4 @@
//include the footer
require_once "resources/footer.php";
-?>
\ No newline at end of file
+?>
|