smarty_table_ordered_th: fix computing URL

This commit is contained in:
Benjamin Renard 2023-01-30 11:24:13 +01:00
parent 541b447cbf
commit d422afa66e
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -308,7 +308,8 @@ smarty_register_function('format_size','smarty_format_size');
function smarty_table_ordered_th($params, $smarty) { function smarty_table_ordered_th($params, $smarty) {
if ($params['order'] && $params['url'] && $params['text'] && is_array($params['search'])) { if ($params['order'] && $params['url'] && $params['text'] && is_array($params['search'])) {
echo "<a href='".$params['url']."?order=".$params['order']."'>".$params['text']."</a>"; $params['url'] .= (strpos($params['url'], '?') === false?'?':'&')."order=".$params['order'];
echo "<a href='".$params['url']."'>".$params['text']."</a>";
} }
if ($params['order']==$params['search']['order']) { if ($params['order']==$params['search']['order']) {
echo ( echo (