mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #4754 from tractorcow/pulls/3.2/upload-fixes
BUG prevent UploadField edit form generation for Folders
This commit is contained in:
commit
c2c78c445e
@ -1432,6 +1432,10 @@ class UploadField_ItemHandler extends RequestHandler {
|
||||
*/
|
||||
public function EditForm() {
|
||||
$file = $this->getItem();
|
||||
if(!$file) return $this->httpError(404);
|
||||
if($file instanceof Folder) return $this->httpError(403);
|
||||
if(!$file->canEdit()) return $this->httpError(403);
|
||||
|
||||
// Get form components
|
||||
$fields = $this->parent->getFileEditFields($file);
|
||||
$actions = $this->parent->getFileEditActions($file);
|
||||
|
Loading…
Reference in New Issue
Block a user