[TikiWiki-commits] [Git][tikiwiki/tiki][master] Fix plugin arg filtering on arrays

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <698b5dc132c2e_3b184f0c8966a@gitlab-sidekiq-low-urgency-cpu-bound-v2-6c7f7654c9-jn5jk.mail>

luci pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
6ee9c15b by Jonny Bradley at 2026-02-10T16:19:41+00:00
Fix plugin arg filtering on arrays
---
* [REF] phpcs

* [DOC] filters: Update return type on `array_apply_filter`

* [FIX] plugins: Handle array args in `plugin_apply_filters` to avoid fatal `htmldecode` errors

See merge request tikiwiki/tiki!9536

- - - - -


2 changed files:

- lib/parser/parserlib.php
- lib/tikilib.php


Changes:

=====================================
lib/parser/parserlib.php
=====================================
@@ -1211,13 +1211,21 @@ class ParserLib extends TikiDb_Bridge
 
                 // Preserve null values (parameters not provided by user)
                 if ($argValue !== null) {
-                    $argValue = TikiLib::htmldecode($argValue);
+                    if (is_array($argValue)) {
+                        foreach ($argValue as &$value) {
+                            $value = TikiLib::htmldecode($value);
+                        }
+                    } else {
+                        $argValue = TikiLib::htmldecode($argValue);
+                    }
                 }
 
-                if (isset($paramInfo['separator'])) {
+                if (isset($paramInfo['separator']) && ! is_array($argValue)) {
                     if ($argValue !== null) {
-                        $vals = [];
-                        $vals = $tikilib->array_apply_filter($tikilib->multi_explode($paramInfo['separator'], $argValue), $filter);
+                        $vals = $tikilib->array_apply_filter(
+                            $tikilib->multi_explode($paramInfo['separator'], $argValue),
+                            $filter
+                        );
                         $argValue = array_values($vals);
                     }
                     // If $argValue is null, leave it as null (don't process separator)


=====================================
lib/tikilib.php
=====================================
@@ -6919,7 +6919,7 @@ class TikiLib extends TikiDb_Bridge
     /**
      * @param $vals
      * @param $filter
-     * @return string
+     * @return string|array
      */
     public function array_apply_filter($vals, $filter)
     {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/6ee9c15b177cb186ec24cd70f181b1956a4f47b1

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