diff --git a/lib/filestorage/file_storage.php b/lib/filestorage/file_storage.php index 0480bf794ba..38a20a11026 100644 --- a/lib/filestorage/file_storage.php +++ b/lib/filestorage/file_storage.php @@ -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;