Skip to content

Commit

Permalink
[media] File download should retrive decoded path (#6137)
Browse files Browse the repository at this point in the history
This aims to fix a bug that was experienced by a CCNA user when trying to download a file that had a '&' in the name. SQL encodes strings containing special chars and thus we need to use the decoded file names in the path when downloading files from media module.

    Resolves #6136
  • Loading branch information
jesscall authored Jun 1, 2020
1 parent cf52280 commit 8a877df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/media/ajax/FileDownload.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

// Make sure that the user isn't trying to break out of the $path
// by using a relative filename.
$file = basename($_GET['File']);
$file = html_entity_decode(basename($_GET['File']));
$config =& NDB_Config::singleton();
$path = $config->getSetting('mediaPath');
$filePath = $path . $file;
Expand Down

0 comments on commit 8a877df

Please sign in to comment.