From 3b73e5223e4a0f9dfae3a456ff5b3b6dec03ab76 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 15 Jul 2019 15:05:54 +0200 Subject: stringify_array_elms() could return weird results if the initial array key was not zero. this could trigger obscure bugs e.g. adding an empty string value to the recipients array in the notifier which could then select some broken hubloc/xchan entries. --- include/text.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index a2dfda952..8ce6b5d7c 100644 --- a/include/text.php +++ b/include/text.php @@ -2456,8 +2456,8 @@ function magic_link($s) { * @param boolean $escape (optional) default false */ function stringify_array_elms(&$arr, $escape = false) { - for($x = 0; $x < count($arr); $x ++) - $arr[$x] = "'" . (($escape) ? dbesc($arr[$x]) : $arr[$x]) . "'"; + foreach($arr as $k => $v) + $arr[$k] = "'" . (($escape) ? dbesc($v) : $v) . "'"; } -- cgit v1.2.3