Skip to content

Commit 7b0074b

Browse files
committed
Bug-fix.
Changelog excerpt: - Fixed a passing null parameter error in the arrayToClickableList method.
1 parent 5417aa0 commit 7b0074b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,5 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
203203
[2024.07.23; Maikuolan]: Added MDN to the front-end's "useful links".
204204

205205
[2024.09.02; Maikuolan]: Code-style patch.
206+
207+
[2024.09.26; Bug-fix; Maikuolan]: Fixed a passing null parameter error in the arrayToClickableList method.

src/FrontEnd.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: Front-end handler (last modified: 2024.09.02).
11+
* This file: Front-end handler (last modified: 2024.09.26).
1212
*/
1313

1414
namespace phpMussel\FrontEnd;
@@ -1361,6 +1361,9 @@ private function arrayToClickableList(array $Arr = [], string $DeleteKey = '', i
13611361
$Count = count($Arr);
13621362
$Prefix = substr($DeleteKey, 0, 2) === 'fe' ? 'FE' : '';
13631363
foreach ($Arr as $Key => $Value) {
1364+
if (is_null($Value)) {
1365+
continue;
1366+
}
13641367
$Delete = ($Depth === 0) ? ' – (<span style="cursor:pointer" onclick="javascript:' . $DeleteKey . '(\'' . addslashes($Key) . '\')"><code class="s"><span class="txtRd">⌧</span>' . $this->Loader->L10N->getString('field.Delete') . '</code></span>)' : '';
13651368
$Output .= ($Depth === 0 ? '<span id="' . $Key . $Prefix . 'Container">' : '') . '<li>';
13661369
if (is_string($Value)) {
@@ -1396,7 +1399,7 @@ private function arrayToClickableList(array $Arr = [], string $DeleteKey = '', i
13961399
$Output .= '<span class="comCat"><code class="s">' . str_replace(['<', '>'], ['&lt;', '&gt;'], $Key) . '</code></span>' . $Delete . '<ul class="comSub">';
13971400
$Output .= $this->arrayToClickableList($Value, $DeleteKey, $Depth + 1, $Key);
13981401
$Output .= '</ul>';
1399-
} else {
1402+
} elseif (is_scalar($Value)) {
14001403
if ($Key === 'Time' && preg_match('~^\d+$~', $Value)) {
14011404
$Key = $this->Loader->L10N->getString('label.Expires');
14021405
$Value = $this->Loader->timeFormat($Value, $this->Loader->Configuration['core']['time_format']);

0 commit comments

Comments
 (0)