[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] PHP 8 warnings in PluginIncludeTpl when values parameter is missing

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <694934ae7c8a_2a17fcc8567fc@gitlab-sidekiq-low-urgency-cpu-bound-v2-988754444-t9tbw.mail>

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


Commits:
05638edb by Olivier Kango at 2025-12-22T11:59:21+00:00
[FIX] PHP 8 warnings in PluginIncludeTpl when values parameter is missing
---
* [FIX] simplify values parsing for PHP 8

* [FIX] PluginIncludeTpl: guard access to values parameter for PHP 8

* [FIX] Prevent PHP 8 warnings in PluginIncludeTpl when parsing values

* [FIX] PHP 8 warnings in PluginIncludeTpl when values parameter is missing

See merge request tikiwiki/tiki!9237

- - - - -


1 changed file:

- lib/wiki-plugins/wikiplugin_includetpl.php


Changes:

=====================================
lib/wiki-plugins/wikiplugin_includetpl.php
=====================================
@@ -41,15 +41,15 @@ function wikiplugin_includetpl_info()
 function wikiplugin_includetpl($data, $params)
 {
     $smarty = TikiLib::lib('smarty');
-    if (stripos($params["values"], '&')) {
+    $defvalues = [];
+    if (! empty($params["values"])) {
         $paramvalues = explode('&', $params["values"]);
         foreach ($paramvalues as $value) {
-            $tempvalues = explode(':', $value);
-            $defvalues[$tempvalues[0]] = $tempvalues[1];
+            $tempvalues = explode(':', $value, 2);
+            if (isset($tempvalues[1])) {
+                $defvalues[$tempvalues[0]] = $tempvalues[1];
+            }
         }
-    } else {
-        $tempvalues = explode(':', $params["values"]);
-        $defvalues[$tempvalues[0]] = $tempvalues[1];
     }
 
     $smarty->assign('values', $defvalues);



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

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