Avoid sort order build-up in sort URL parameter string

Fixes behaviour where each new sort added &order=n to the query string.
This commit is contained in:
df 2020-06-15 03:31:28 +00:00 committed by HummyPkg
parent 478d9db2e2
commit 9cf915e5f7

View File

@ -379,7 +379,8 @@ foreach sl $sortlist {
set tag " (current)"
if {$order != $index} {
puts "<a href=\"$env(SCRIPT_NAME)?$env(QUERY_STRING)&order=$index\">"
set qs [regsub -all {&order=[[[:digit:]]+} $env(QUERY_STRING) ""]
puts "<a href=\"$env(SCRIPT_NAME)?$qs&order=$index\">"
set tag ""
}
puts "<img class=va border=0 src=/img/$img.gif> $descr$tag"