mirror of
https://github.com/moodle/moodle.git
synced 2025-01-30 03:58:34 +01:00
Merge branch 'MDL-54916' of https://github.com/mr-russ/moodle
This commit is contained in:
commit
a584a403cd
@ -207,6 +207,12 @@ class zip_archive extends file_archive {
|
||||
$this->mode = null;
|
||||
$this->namelookup = null;
|
||||
$this->modified = false;
|
||||
// If the existing archive is already empty, we didn't change it. Don't bother completing a save.
|
||||
// This is important when we are inspecting archives that we might not have write permission to.
|
||||
if (@filesize($this->archivepathname) == 22 &&
|
||||
@file_get_contents($this->archivepathname) === base64_decode(self::$emptyzipcontent)) {
|
||||
return true;
|
||||
}
|
||||
@unlink($this->archivepathname);
|
||||
$data = base64_decode(self::$emptyzipcontent);
|
||||
if (!file_put_contents($this->archivepathname, $data)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user