From: TheSFReader Date: Fri, 25 Jan 2013 16:02:44 +0000 (+0100) Subject: Simplify the code and remove a first unnecessary (and non conform) '&' character... X-Git-Tag: v5.0.0alpha1~176^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9f5847b739c20a0b2de3672459445f08300ef790;p=nextcloud-server.git Simplify the code and remove a first unnecessary (and non conform) '&' character when there are pending arguments --- diff --git a/lib/helper.php b/lib/helper.php index 5d7e3fa4894..540a7dceb3e 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -78,11 +78,8 @@ class OC_Helper { } } - if (!empty($args)) { - $urlLinkTo .= '?'; - foreach($args as $k => $v) { - $urlLinkTo .= '&'.$k.'='.urlencode($v); - } + if ($args && $query = http_build_query($args, '', '&')) { + $urlLinkTo .= '?'.$query; } return $urlLinkTo;