MDL-57801 core_filestorage: Delete temp file if disk space runs out

This commit is contained in:
Tony Butler
2017-02-16 12:41:06 +00:00
parent 961323a05f
commit efa7d24168
+1
View File
@@ -421,6 +421,7 @@ class file_system_filedir extends file_system {
@unlink($hashfile.'.tmp');
if (!copy($pathname, $hashfile.'.tmp')) {
// Borked permissions or out of disk space.
@unlink($hashfile.'.tmp');
ignore_user_abort($prev);
throw new file_exception('storedfilecannotcreatefile');
}