Merge branch 'MDL-71991_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE
This commit is contained in:
@@ -391,7 +391,14 @@ class file_system_filedir extends file_system {
|
||||
ignore_user_abort($prev);
|
||||
throw new file_exception('storedfilecannotcreatefile');
|
||||
}
|
||||
rename($hashfile.'.tmp', $hashfile);
|
||||
if (!rename($hashfile.'.tmp', $hashfile)) {
|
||||
// Something very strange went wrong.
|
||||
@unlink($hashfile . '.tmp');
|
||||
// Note, we don't try to clean up $hashfile. Almost certainly, if it exists
|
||||
// (e.g. written by another process?) it will be right, so don't wipe it.
|
||||
ignore_user_abort($prev);
|
||||
throw new file_exception('storedfilecannotcreatefile');
|
||||
}
|
||||
chmod($hashfile, $this->filepermissions); // Fix permissions if needed.
|
||||
@unlink($hashfile.'.tmp'); // Just in case anything fails in a weird way.
|
||||
ignore_user_abort($prev);
|
||||
@@ -465,7 +472,14 @@ class file_system_filedir extends file_system {
|
||||
ignore_user_abort($prev);
|
||||
throw new file_exception('storedfilecannotcreatefile');
|
||||
}
|
||||
rename($hashfile.'.tmp', $hashfile);
|
||||
if (!rename($hashfile.'.tmp', $hashfile)) {
|
||||
// Something very strange went wrong.
|
||||
@unlink($hashfile . '.tmp');
|
||||
// Note, we don't try to clean up $hashfile. Almost certainly, if it exists
|
||||
// (e.g. written by another process?) it will be right, so don't wipe it.
|
||||
ignore_user_abort($prev);
|
||||
throw new file_exception('storedfilecannotcreatefile');
|
||||
}
|
||||
chmod($hashfile, $this->filepermissions); // Fix permissions if needed.
|
||||
@unlink($hashfile.'.tmp'); // Just in case anything fails in a weird way.
|
||||
ignore_user_abort($prev);
|
||||
|
||||
Reference in New Issue
Block a user