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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user