From 44975e7e0a30a9d8a7119e70cf8cd1a8ba75804c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 13 Jun 2017 12:43:38 +0200 Subject: [PATCH] Simplify code for generating URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no need to build it manually Signed-off-by: Michal Čihař --- libraries/Util.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/libraries/Util.php b/libraries/Util.php index f2e5e4e795..fb781d41ba 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -1644,22 +1644,17 @@ class Util } } - // If there are any tab specific URL parameters, merge those with - // the general URL parameters - if (! empty($tab['url_params']) && is_array($tab['url_params'])) { - $url_params = array_merge($url_params, $tab['url_params']); - } - // build the link if (! empty($tab['link'])) { - $tab['link'] = htmlentities($tab['link']); - $tab['link'] = $tab['link'] . URL::getCommon($url_params); - if (! empty($tab['args'])) { - foreach ($tab['args'] as $param => $value) { - $tab['link'] .= URL::getArgSeparator('html') - . urlencode($param) . '=' . urlencode($value); - } + // If there are any tab specific URL parameters, merge those with + // the general URL parameters + if (! empty($tab['url_params']) && is_array($tab['url_params'])) { + $url_params = array_merge($url_params, $tab['url_params']); } + if (! empty($tab['args']) && is_array($tab['args'])) { + $url_params = array_merge($url_params, $tab['args']); + } + $tab['link'] = htmlentities($tab['link']) . URL::getCommon($url_params); } if (! empty($tab['fragment'])) {