diff --git a/boot.php b/boot.php index b8705fdf1..eb04732c5 100644 --- a/boot.php +++ b/boot.php @@ -534,39 +534,6 @@ function is_site_admin() return local_user() && $admin_email && in_array(defaults($a->user, 'email', ''), $adminlist); } -/** - * @brief Returns querystring as string from a mapped array. - * - * @param array $params mapped array with query parameters - * @param string $name of parameter, default null - * - * @return string - */ -function build_querystring($params, $name = null) -{ - $ret = ""; - foreach ($params as $key => $val) { - if (is_array($val)) { - /// @TODO maybe not compare against null, use is_null() - if ($name == null) { - $ret .= build_querystring($val, $key); - } else { - $ret .= build_querystring($val, $name . "[$key]"); - } - } else { - $val = urlencode($val); - /// @TODO maybe not compare against null, use is_null() - if ($name != null) { - /// @TODO two string concated, can be merged to one - $ret .= $name . "[$key]" . "=$val&"; - } else { - $ret .= "$key=$val&"; - } - } - } - return $ret; -} - function explode_querystring($query) { $arg_st = strpos($query, '?'); diff --git a/mod/network.php b/mod/network.php index c8786b2f7..009f70b60 100644 --- a/mod/network.php +++ b/mod/network.php @@ -140,7 +140,7 @@ function network_init(App $a) if ($remember_tab) { $net_args = array_merge($query_array, $net_args); - $net_queries = build_querystring($net_args); + $net_queries = http_build_query($net_args); $redir_url = ($net_queries ? $net_baseurl . '?' . $net_queries : $net_baseurl);