Added missing box title validation
authorMarcel Werk <burntime@woltlab.com>
Mon, 26 Sep 2016 14:30:06 +0000 (16:30 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 26 Sep 2016 14:30:06 +0000 (16:30 +0200)
wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php

index eed892230eee39bac70f0a90e615148ffd705fcf..fdd3280ac90f9957bc01029b6f88a682f9c3ca76 100644 (file)
@@ -386,6 +386,18 @@ class BoxAddForm extends AbstractForm {
                        }
                }
                
+               // box title
+               if ($this->showHeader) {
+                       if ($this->boxType == 'system' || $this->isMultilingual) {
+                               foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
+                                       if (empty($this->title[$language->languageID])) throw new UserInputException('title'.$language->languageID);
+                               }
+                       }
+                       else {
+                               if (empty($this->title[0])) throw new UserInputException('title');
+                       }
+               }
+               
                if ($this->boxController && $this->boxController->getProcessor() instanceof IConditionBoxController) {
                        $this->boxController->getProcessor()->validateConditions();
                }