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

This commit is contained in:
Tony Butler
2017-02-16 12:48:57 +00:00
parent 131e69e29b
commit 8e99e8c014
+1
View File
@@ -1987,6 +1987,7 @@ class file_storage {
@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');
}