Minor fix in 'classes/articles.php'.

It looks like these functions are dead code, though.  Adding comments for future review.
This commit is contained in:
wn_ 2021-11-16 02:14:31 +00:00
parent b2952843f5
commit d78ba7b3a9
1 changed files with 4 additions and 1 deletions

View File

@ -257,18 +257,21 @@ class Article extends Handler_Protected {
print "</ul>"; print "</ul>";
}*/ }*/
// TODO: dead code?
function assigntolabel(): void { function assigntolabel(): void {
$this->_label_ops(true); $this->_label_ops(true);
} }
// TODO: dead code?
function removefromlabel(): void { function removefromlabel(): void {
$this->_label_ops(false); $this->_label_ops(false);
} }
// TODO: dead code?
private function _label_ops(bool $assign): void { private function _label_ops(bool $assign): void {
$reply = array(); $reply = array();
$ids = array_map("intval", explode(",", clean($_REQUEST["ids"] ?? []))); $ids = array_map("intval", array_filter(explode(",", clean($_REQUEST["ids"] ?? "")), "strlen"));
$label_id = clean($_REQUEST["lid"]); $label_id = clean($_REQUEST["lid"]);
$label = Labels::find_caption($label_id, $_SESSION["uid"]); $label = Labels::find_caption($label_id, $_SESSION["uid"]);