Skip to content
Permalink
Browse files Browse the repository at this point in the history
Update music_on_hold.php
  • Loading branch information
Nate committed Aug 19, 2019
1 parent 33aad11 commit 95ed18a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/music_on_hold/music_on_hold.php
Expand Up @@ -86,6 +86,9 @@
$stream_file = base64_decode($_GET['file']);
$stream_full_path = path_join($stream_path, $stream_file);

//sanitize path
$stream_full_path = str_replace('../', '', $stream_full_path);

//dowload the file
session_cache_limiter('public');
if (file_exists($stream_full_path)) {
Expand Down Expand Up @@ -284,13 +287,21 @@
}
}

//replace the sounds_dir variable in the path
$stream_path = str_replace('$${sounds_dir}', $_SESSION['switch']['sounds']['dir'], $stream_path);

//check permissions
if (($stream_domain_uuid == '' && permission_exists('music_on_hold_domain')) ||
($stream_domain_uuid != '' && permission_exists('music_on_hold_delete'))) {

//remove specified file
if ($stream_file != '') {
@unlink(path_join($stream_path, $stream_file));
//define path
$stream_full_path = path_join($stream_path, $stream_file);
//sanitize path
$stream_full_path = str_replace('../', '', $stream_full_path);
//delete file
@unlink($stream_full_path);
}
//remove all audio files
else {
Expand Down

0 comments on commit 95ed18a

Please sign in to comment.