projects
/
GitHub
/
WoltLab
/
WCF.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix the handling of validation errors
[GitHub/WoltLab/WCF.git]
/
wcfsetup
/
install
/
files
/
lib
/
system
/
file
/
processor
/
AttachmentFileProcessor.class.php
diff --git
a/wcfsetup/install/files/lib/system/file/processor/AttachmentFileProcessor.class.php
b/wcfsetup/install/files/lib/system/file/processor/AttachmentFileProcessor.class.php
index 5e954d9fd6555200971ca7f5e205296316e4f16c..a3847e976e5ef0e0209fd3a92a5c7ca4591bd69d 100644
(file)
--- a/
wcfsetup/install/files/lib/system/file/processor/AttachmentFileProcessor.class.php
+++ b/
wcfsetup/install/files/lib/system/file/processor/AttachmentFileProcessor.class.php
@@
-100,8
+100,12
@@
final class AttachmentFileProcessor implements IFileProcessor
#[\Override]
public function canDelete(File $file): bool
{
- // TODO
- return true;
+ $attachment = Attachment::findByFileID($file->fileID);
+ if ($attachment === null) {
+ return false;
+ }
+
+ return $attachment->canDelete();
}
#[\Override]