MDL-55513 core_filestorage: Touch and test size instead of file_exists()

file_exists() can return false when file exists (in certain scenarios)
This commit is contained in:
Tony Butler
2016-08-10 09:35:23 +01:00
parent e98483d748
commit 2ee668ec56
+2 -1
View File
@@ -386,7 +386,8 @@ class file_storage {
chdir($tmp);
$result = exec($cmd, $output);
chdir($currentdir);
if (!file_exists($newtmpfile)) {
touch($newtmpfile);
if (filesize($newtmpfile) === 0) {
remove_dir($tmp);
// Cleanup.
return false;