diff --git a/app/recordings/recording_edit.php b/app/recordings/recording_edit.php index 1c79147f47..2751b928b7 100644 --- a/app/recordings/recording_edit.php +++ b/app/recordings/recording_edit.php @@ -245,7 +245,8 @@ exec('sox --ignore-length '.escapeshellarg($recording_path.'/'.$recording_filename).' '.escapeshellarg($recording_path.'/'.$recording_filename_temp)); } if (file_exists($recording_path.'/'.$recording_filename_temp)) { - exec('rm -f '.escapeshellarg($recording_path.'/'.$recording_filename).' && mv '.escapeshellarg($recording_path.'/'.$recording_filename_temp).' '.escapeshellarg($recording_path.'/'.$recording_filename)); + recursive_delete($recording_path.'/'.$recording_filename); + exec('mv '.escapeshellarg($recording_path.'/'.$recording_filename_temp).' '.escapeshellarg($recording_path.'/'.$recording_filename)); } unset($recording_filename_temp); } diff --git a/app/voicemail_greetings/voicemail_greeting_edit.php b/app/voicemail_greetings/voicemail_greeting_edit.php index 57c459e52f..2238cd979a 100644 --- a/app/voicemail_greetings/voicemail_greeting_edit.php +++ b/app/voicemail_greetings/voicemail_greeting_edit.php @@ -235,7 +235,8 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) { $greeting_filename_temp = str_replace('.'.$greeting_format, '.tmp.'.$greeting_format, $greeting_filename); exec('sox --ignore-length '.$greeting_path.'/'.$greeting_filename.' '.$greeting_path.'/'.$greeting_filename_temp); if (file_exists($greeting_path.$greeting_filename_temp)) { - exec('rm -f '.$greeting_path.'/'.$greeting_filename.' && mv '.$greeting_path.'/'.$greeting_filename_temp.' '.$greeting_path.'/'.$greeting_filename); + recursive_delete($greeting_path.'/'.$greeting_filename); + exec('mv '.$greeting_path.'/'.$greeting_filename_temp.' '.$greeting_path.'/'.$greeting_filename); } unset($greeting_filename_temp); }