Skip to content

Commit

Permalink
MDL-57801 core_filestorage: Delete temp file if disk space runs out
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyjbutler committed Feb 16, 2017
1 parent dcd27d9 commit b577d34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/filestorage/file_storage.php
Expand Up @@ -2001,6 +2001,7 @@ public function add_file_to_pool($pathname, $contenthash = NULL) {
@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');
}
Expand Down

0 comments on commit b577d34

Please sign in to comment.