[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [BP][FIX] tiki-view_articles.php : Handles invalid/non-existent article type, topic or category

"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6923701132577_2a17f110131ed@gitlab-sidekiq-low-urgency-cpu-bound-v2-5d57c968f-lvzp8.mail>

ushindi bienvenu pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki


Commits:
9940b0e8 by Alain Cisirika at 2025-11-23T20:28:04+00:00
[BP][FIX] tiki-view_articles.php : Handles invalid/non-existent article type, topic or category
---
* [BP][FIX] tiki-view_articles.php : Handles invalid/non-existent article type, topic or category
---
* [FIX] tiki-view_articles.php : Handles invalid/non-existent article type, topic or category
---
* [FIX] tiki-view_articles.php : Handles invalid/non-existent article type, topic or category

See merge request tikiwiki/tiki!8176

See merge request tikiwiki/tiki!8608

See merge request tikiwiki/tiki!8627

- - - - -


1 changed file:

- tiki-view_articles.php


Changes:

=====================================
tiki-view_articles.php
=====================================
@@ -31,6 +31,7 @@ $inputConfiguration = [
 ];
 require_once('tiki-setup.php');
 $artlib = TikiLib::lib('art');
+$categlib = TikiLib::lib('categ');
 
 if ($prefs['article_use_new_list_articles'] == 'y') {
     include "lists/articles.php";
@@ -103,23 +104,35 @@ if (isset($_REQUEST["find"])) {
     $find = '';
 }
 $smarty->assign_by_ref('find', $find);
-if (isset($_REQUEST["type"])) {
+if (! empty($_REQUEST["type"])) {
     $type = $_REQUEST["type"];
+    if (empty($artlib->get_type($type))) {
+        Feedback::errorAndDie(tra("Invalid article type or it has been deleted."), \Laminas\Http\Response::STATUS_CODE_400);
+    }
 } else {
     $type = '';
 }
-if (isset($_REQUEST["topic"])) {
+if (! empty($_REQUEST["topic"])) {
     $topic = $_REQUEST["topic"];
+    if (empty($artlib->get_topic($topic))) {
+         Feedback::errorAndDie(tra("Invalid article topic or it has been deleted."), \Laminas\Http\Response::STATUS_CODE_400);
+    }
 } else {
     $topic = '';
 }
-if (isset($_REQUEST['topicName'])) {
+if (! empty($_REQUEST['topicName'])) {
     $topicName = $_REQUEST['topicName'];
+    if (empty($artlib->get_topic($topicName))) {
+        Feedback::errorAndDie(tra("Invalid article topic name or it has been deleted."), \Laminas\Http\Response::STATUS_CODE_400);
+    }
 } else {
     $topicName = '';
 }
-if (isset($_REQUEST["categId"])) {
+if (! empty($_REQUEST["categId"])) {
     $categId = $_REQUEST["categId"];
+    if (empty($categlib->get_category($_REQUEST["categId"]))) {
+        Feedback::errorAndDie(tra("Invalid category or it has been deleted."), \Laminas\Http\Response::STATUS_CODE_400);
+    }
 } else {
     $categId = '';
 }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/9940b0e83d84e9df3a724c94c08e9607cbb322bd

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/9940b0e83d84e9df3a724c94c08e9607cbb322bd
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.