From 9f5847b739c20a0b2de3672459445f08300ef790 Mon Sep 17 00:00:00 2001 From: TheSFReader Date: Fri, 25 Jan 2013 17:02:44 +0100 Subject: [PATCH] Simplify the code and remove a first unnecessary (and non conform) '&' character when there are pending arguments --- lib/helper.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/helper.php b/lib/helper.php index 5d7e3fa489..540a7dceb3 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;