aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-07-15 15:05:54 +0200
committerMario Vavti <mario@mariovavti.com>2019-07-15 15:05:54 +0200
commit3b73e5223e4a0f9dfae3a456ff5b3b6dec03ab76 (patch)
treeaf7165dac9a25a9718a45f666264ce9dbe08319a /include/text.php
parenta85f0a93c66ecd9f34403d7cab0934ebf81cfced (diff)
downloadvolse-hubzilla-3b73e5223e4a0f9dfae3a456ff5b3b6dec03ab76.tar.gz
volse-hubzilla-3b73e5223e4a0f9dfae3a456ff5b3b6dec03ab76.tar.bz2
volse-hubzilla-3b73e5223e4a0f9dfae3a456ff5b3b6dec03ab76.zip
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.
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php4
1 files changed, 2 insertions, 2 deletions
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) . "'";
}