Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

0.16.11 - Unreleased
-------------------------
- Fix #267: Include only accessible folders and files in a downloading zip archive

0.16.10 - August 1, 2025
-------------------------
Warning: This release contains two [security fixes](https://github.com/humhub/cfiles/security/advisories), and an update is strongly recommended.
Expand Down
10 changes: 7 additions & 3 deletions libs/ZIPCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function addFile($file, $path = '', $fileName = null)
$file = $file->baseFile;
}

if (!$file) {
if (!$file || !$file->canView()) {
return;
}

Expand All @@ -127,12 +127,16 @@ public function addFile($file, $path = '', $fileName = null)
*/
public function addFolder(Folder $folder, $path = '')
{
if (!$folder->content->canView()) {
return;
}

$path = $this->fixPath($path . DIRECTORY_SEPARATOR . $folder->title);

$this->archive->addEmptyDir($path);

$subFiles = CFile::find()->where(['parent_folder_id' => $folder->id])->all();
$subFolders = Folder::find()->where(['parent_folder_id' => $folder->id])->all();
$subFiles = CFile::find()->readable()->where(['parent_folder_id' => $folder->id])->all();
$subFolders = Folder::find()->readable()->where(['parent_folder_id' => $folder->id])->all();

foreach ($subFiles as $file) {
$this->addFile($file, $path);
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"organisation",
"sharing"
],
"version": "0.16.10",
"version": "0.16.11",
"humhub": {
"minVersion": "1.14"
},
Expand Down
Loading