Do not allow setting an inaccessible category in ArticleAction::validateSetCategory()
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:42:51 +0000 (14:42 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 18 Apr 2023 07:42:02 +0000 (09:42 +0200)
wcfsetup/install/files/lib/data/article/ArticleAction.class.php

index d44c02325cfa5d675090e9b210a0edc12d4b3a98..172b265c16c6393f5973640b9607f8140b37ea30 100644 (file)
@@ -632,7 +632,11 @@ class ArticleAction extends AbstractDatabaseObjectAction {
                }
                
                $this->readInteger('categoryID');
-               if (ArticleCategory::getCategory($this->parameters['categoryID']) === null) {
+               $category = ArticleCategory::getCategory($this->parameters['categoryID']);
+               if ($category === null) {
+                       throw new UserInputException('categoryID');
+               }
+               if (!$category->isAccessible()) {
                        throw new UserInputException('categoryID');
                }
        }