From: Tim Düsterhus Date: Tue, 28 Mar 2023 12:41:54 +0000 (+0200) Subject: Validate if an article may be edited in `setCategory` clipboard action X-Git-Tag: 5.3.28~2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1bc95472c3310b19cba36e90b59ec146751bbd4c;p=GitHub%2FWoltLab%2FWCF.git Validate if an article may be edited in `setCategory` clipboard action --- diff --git a/wcfsetup/install/files/lib/system/clipboard/action/ArticleClipboardAction.class.php b/wcfsetup/install/files/lib/system/clipboard/action/ArticleClipboardAction.class.php index be1650447f..4502f6f523 100644 --- a/wcfsetup/install/files/lib/system/clipboard/action/ArticleClipboardAction.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/action/ArticleClipboardAction.class.php @@ -142,7 +142,16 @@ class ArticleClipboardAction extends AbstractClipboardAction { return []; } - return array_keys($this->objects); + $objectIDs = []; + + /** @var Article $article */ + foreach ($this->objects as $article) { + if ($article->canEdit()) { + $objectIDs[] = $article->articleID; + } + } + + return $objectIDs; } /**