Make `WysiwygAttachmentFormField` only available if upload is allowed
authorMatthias Schmidt <gravatronics@live.com>
Tue, 15 Jun 2021 12:55:02 +0000 (14:55 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 15 Jun 2021 12:55:02 +0000 (14:55 +0200)
The same check exists in the non-form builder template `messageFormTabs.tpl`.

wcfsetup/install/files/lib/system/form/builder/field/wysiwyg/WysiwygAttachmentFormField.class.php

index 93d778edfefcfb0e998517c86a46d8479e4a3a1e..ceb9b29b236c1c6771ee6f5107d85b66a3b4db9d 100644 (file)
@@ -113,7 +113,9 @@ class WysiwygAttachmentFormField extends AbstractFormField {
         * @inheritDoc
         */
        public function isAvailable() {
-               return parent::isAvailable() && $this->getAttachmentHandler() !== null;
+               return parent::isAvailable()
+                       && $this->getAttachmentHandler() !== null
+                       && $this->getAttachmentHandler()->canUpload();
        }
        
        /**