mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
MDL-70901 core: @ no longer masks errors in PHP 8.0
This commit is contained in:
parent
2d059d1657
commit
b88f1a84bf
@ -97,7 +97,7 @@ class file_logger extends base_logger {
|
||||
} else {
|
||||
$content = $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
|
||||
}
|
||||
if (false === fwrite($this->fhandle, $content)) {
|
||||
if (!is_resource($this->fhandle) || (false === fwrite($this->fhandle, $content))) {
|
||||
throw new base_logger_exception('error_writing_file', $this->fullpath);
|
||||
}
|
||||
return true;
|
||||
|
@ -90,7 +90,11 @@ class file_temp_cleanup_task extends scheduled_task {
|
||||
} else {
|
||||
// Return the time modified to the original date only for real files.
|
||||
if ($iter->isDir() && !$iter->isDot()) {
|
||||
touch($node, $modifieddateobject[$node]);
|
||||
try {
|
||||
@touch($node, $modifieddateobject[$node]);
|
||||
} catch (\Throwable $t) {
|
||||
null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +395,10 @@ class file_system_filedir extends file_system {
|
||||
}
|
||||
rename($hashfile.'.tmp', $hashfile);
|
||||
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);
|
||||
|
||||
return array($contenthash, $filesize, $newfile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user