MDL-55246 assign: convert files with spaces

If a file is sent to unoconv with a filename that contains spaces,
unoconv will fail to produce the intended results.
This commit is contained in:
Matt Davidson
2016-08-05 08:16:01 -04:00
parent 56394c8bd6
commit c79398ea60
+2 -2
View File
@@ -354,9 +354,9 @@ class file_storage {
// Copy the file to the tmp dir.
$uniqdir = "core_file/conversions/" . uniqid($file->get_id() . "-", true);
$tmp = make_temp_directory($uniqdir);
$localfilename = $file->get_filename();
$ext = pathinfo($file->get_filename(), PATHINFO_EXTENSION);
// Safety.
$localfilename = clean_param($localfilename, PARAM_FILE);
$localfilename = $file->get_id() . '.' . $ext;
$filename = $tmp . '/' . $localfilename;
try {