mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 19:36:41 +02:00
MDL-70901 core_files: @ does no mask errors in php8 anymore
This commit is contained in:
parent
8b5bd4fb00
commit
03b198f45d
1 changed files with 7 additions and 2 deletions
|
@ -378,7 +378,9 @@ class file_system_filedir extends file_system {
|
||||||
// Let's try to prevent some race conditions.
|
// Let's try to prevent some race conditions.
|
||||||
|
|
||||||
$prev = ignore_user_abort(true);
|
$prev = ignore_user_abort(true);
|
||||||
@unlink($hashfile.'.tmp');
|
if (file_exists($hashfile.'.tmp')) {
|
||||||
|
@unlink($hashfile.'.tmp');
|
||||||
|
}
|
||||||
if (!copy($pathname, $hashfile.'.tmp')) {
|
if (!copy($pathname, $hashfile.'.tmp')) {
|
||||||
// Borked permissions or out of disk space.
|
// Borked permissions or out of disk space.
|
||||||
@unlink($hashfile.'.tmp');
|
@unlink($hashfile.'.tmp');
|
||||||
|
@ -467,7 +469,10 @@ class file_system_filedir extends file_system {
|
||||||
}
|
}
|
||||||
rename($hashfile.'.tmp', $hashfile);
|
rename($hashfile.'.tmp', $hashfile);
|
||||||
chmod($hashfile, $this->filepermissions); // Fix permissions if needed.
|
chmod($hashfile, $this->filepermissions); // Fix permissions if needed.
|
||||||
@unlink($hashfile.'.tmp'); // Just in case anything fails in a weird way.
|
if (file_exists($hashfile.'.tmp')) {
|
||||||
|
// Just in case anything fails in a weird way.
|
||||||
|
@unlink($hashfile.'.tmp');
|
||||||
|
}
|
||||||
ignore_user_abort($prev);
|
ignore_user_abort($prev);
|
||||||
|
|
||||||
return array($contenthash, $filesize, $newfile);
|
return array($contenthash, $filesize, $newfile);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue