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

This commit is contained in:
Tony Butler
2017-02-16 12:46:46 +00:00
parent dcd27d9cee
commit b577d34861
+1
View File
@@ -2001,6 +2001,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');
}