Simplify code for generating URL

There is no need to build it manually

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2017-06-13 12:43:38 +02:00
parent 45640d5e0f
commit 44975e7e0a

View File

@ -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'])) {