stable

Clone or download

Read-only

[bug] Download as zip feature must check that provided item is a folder

This fixes request #14939 Crash when trying to download of a document manager item that is not a folder While the situation is not expected in a normal utilization of the service a complete crash of the app is not an acceptable response. Returning a 400 or 404 would have been expected. The static analysis did not catch the issue because the type has been manually set to the expected one without proper checks. To reproduce this issue, go to plugins/document/:project_name/folders/:id/download-folder-as-zip where :id is the ID of an item that is not a folder and :project_name the project shortname where the item is stored. Change-Id: Ib73c4c6c741b975f4c24017d60988db50b8999e5

Modified Files

Name
M plugins/document/include/DownloadFolderAsZip/DocumentFolderZipStreamer.php +5 −1 Go to diff View file
A plugins/document/include/DownloadFolderAsZip/ItemIsNotAFolderException.php +33 −0 Go to diff View file