]> git.mxchange.org Git - friendica.git/commitdiff
Replace build_querystring() by http_build_query() introduced in PHP 5
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 May 2019 21:18:42 +0000 (17:18 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 May 2019 21:40:12 +0000 (17:40 -0400)
boot.php
mod/network.php

index b8705fdf133cadb057f0ec82cab00d688a6971b5..eb04732c5d87bcc56cdda0784f1a061bd9db0289 100644 (file)
--- 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, '?');
index c8786b2f7b372b47fd5640e468fa77718e5d7e44..009f70b606d4e54a39c17927358eede1a8b0f8e5 100644 (file)
@@ -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);