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.

This commit is contained in:
Mario Vavti 2019-07-15 15:05:54 +02:00
parent a85f0a93c6
commit 3b73e5223e

View File

@ -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) . "'";
}