[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Custom modules: prevent "array offset on null" warning from nested module plugins

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a8c9b1cd9c55_3818cf90319df@gitlab-sidekiq-low-urgency-cpu-bound-v2-86f7767884-2rvkn.mail>

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


Commits:
a39034aa by UshindiG at 2026-08-24T19:13:35+00:00
[FIX] Custom modules: prevent "array offset on null" warning from nested module plugins
---
* [FIX] Custom modules: prevent "array offset on null" warning from nested module plugins

See merge request tikiwiki/tiki!10990

- - - - -


2 changed files:

- lib/core/Tiki/Smarty/SmartyTikiErrorHandler.php
- lib/modules/modlib.php


Changes:

=====================================
lib/core/Tiki/Smarty/SmartyTikiErrorHandler.php
=====================================
@@ -80,7 +80,7 @@ class SmartyTikiErrorHandler
                 $suppressedAnError = true;
             } elseif (
                 preg_match(
-                    '/^(Undefined index|Undefined array key|Trying to access array offset on value of type)/',
+                    '/^(Undefined index|Undefined array key|Trying to access array offset on (value of type|null))/',
                     $errstr
                 )
             ) {


=====================================
lib/modules/modlib.php
=====================================
@@ -1342,7 +1342,8 @@ class ModLib extends TikiLib
             $info = $this->parse($info);
 
             // re-assign module_params for the custom module in case a module plugin is used inside it
-            $smarty->assign_by_ref('user_module_params', $module_params);
+            // by value, not by ref, so a nested recursive call can't repoint it
+            $smarty->assign('user_module_params', (array) $module_params);
             $smarty->assign('user_title', tra($info['title']));
             $smarty->assign_by_ref('user_data', $info['data']);
             $smarty->assign_by_ref('user_module_name', $info['name']);



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a39034aa24727348ded925864f4ca817db17f8c4
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
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.