Merge branch 'MDL-55513-master' of https://github.com/lucisgit/moodle

This commit is contained in:
Andrew Nicols
2016-08-15 14:07:41 +08:00
+5 -4
View File
@@ -365,7 +365,7 @@ class file_storage {
throw new file_exception('storedfileproblem', 'Could not copy file contents to temp file.');
}
} catch (file_exception $fe) {
remove_dir($uniqdir);
remove_dir($tmp);
throw $fe;
}
@@ -386,8 +386,9 @@ class file_storage {
chdir($tmp);
$result = exec($cmd, $output);
chdir($currentdir);
if (!file_exists($newtmpfile)) {
remove_dir($uniqdir);
touch($newtmpfile);
if (filesize($newtmpfile) === 0) {
remove_dir($tmp);
// Cleanup.
return false;
}
@@ -404,7 +405,7 @@ class file_storage {
$convertedfile = $this->create_file_from_pathname($record, $newtmpfile);
// Cleanup.
remove_dir($uniqdir);
remove_dir($tmp);
return $convertedfile;
}