Explorar o código

#274 Language switcher URL isn't correct

Alex Trofimov %!s(int64=10) %!d(string=hai) anos
pai
achega
e8eb2c2a61
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      inc/utils.inc.php

+ 9 - 2
inc/utils.inc.php

@@ -965,8 +965,15 @@ function bx_append_url_params ($sUrl, $mixedParams)
     $sParams = false == strpos($sUrl, '?') ? '?' : '&';
 
     if (is_array($mixedParams)) {
-        foreach($mixedParams as $sKey => $sValue)
-            $sParams .= $sKey . '=' . $sValue . '&';
+        foreach($mixedParams as $sKey => $sValue) {
+            if (!is_array($sValue)) {
+                $sParams .= $sKey . '=' . $sValue . '&';
+            }
+            else {
+                foreach($sValue as $sSubValue)
+                    $sParams .= $sKey . '[]=' . $sSubValue . '&';
+            }
+        }
         $sParams = substr($sParams, 0, -1);
     } else {
         $sParams .= $mixedParams;