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

"Alain Cisirika \(@cisirikalain\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68ccf2fd9e984_2cded00-188@gitlab-sidekiq-low-urgency-cpu-bound-v2-5c44cb6566-8chp2.mail>

Alain Cisirika pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
95ab2bc4 by Alain Cisirika at 2025-09-19T06:00:02+00:00
[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

- - - - -


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";
@@ -100,23 +101,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/95ab2bc40e914aa7a3178b68424511fec348ea3c

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/95ab2bc40e914aa7a3178b68424511fec348ea3c
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.