[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Avoid foreach warning when $params["select"] is null in UserSelector.php

"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68f348b05e57f_2c6c5d310442db@gitlab-sidekiq-low-urgency-cpu-bound-v2-6fddc7596d-lplkt.mail>

ushindi bienvenu pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
1aa095fa by David Maene at 2025-10-18T07:50:52+00:00
[FIX] Avoid foreach warning when $params["select"] is null in UserSelector.php
---
* [FIX] Avoid foreach warning when $params["select"] is null in UserSelector.php

See merge request tikiwiki/tiki!8667

- - - - -


1 changed file:

- lib/smarty_tiki/FunctionHandler/UserSelector.php


Changes:

=====================================
lib/smarty_tiki/FunctionHandler/UserSelector.php
=====================================
@@ -126,12 +126,13 @@ class UserSelector extends Base
             $remoteUrl = TikiLib::lib('service')->getUrl($urlParams);
 
             $options = "";
-            foreach ($params['select'] as $selected) {
+            $selectedValues = $params['select'] ?? [];
+            foreach ($selectedValues as $selected) {
                 $options .= "<option value=\"$selected\" selected>$selected</option>";
             }
             return <<<HTML
                 <select name="{$params['name']}" id="{$params['id']}" class="form-control" data-remote-source-url="{$remoteUrl}" $mt>{$options}</select>
-HTML;
+            HTML;
         }
 
         // get the user list



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

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