URL-encode file paths for first/prev/next/last buttons with sorted files

This commit is contained in:
Seednode 2023-11-07 20:04:48 -06:00
parent 00b8af42fe
commit 9953bb50dc
2 changed files with 6 additions and 5 deletions

View File

@ -12,7 +12,7 @@ import (
)
const (
ReleaseVersion string = "3.2.2"
ReleaseVersion string = "3.2.3"
)
var (

View File

@ -6,6 +6,7 @@ package cmd
import (
"fmt"
"net/url"
"sort"
"strings"
@ -147,28 +148,28 @@ func paginateSorted(path, first, last, queryParams string, regexes *regexes, for
html.WriteString(fmt.Sprintf(`<button onclick="window.location.href = '%s%s%s%s';"%s>First</button>`,
Prefix,
mediaPrefix,
first,
url.QueryEscape(first),
queryParams,
firstStatus))
html.WriteString(fmt.Sprintf(`<button onclick="window.location.href = '%s%s%s%s';"%s>Prev</button>`,
Prefix,
mediaPrefix,
prevPage,
url.QueryEscape(prevPage),
queryParams,
prevStatus))
html.WriteString(fmt.Sprintf(`<button onclick="window.location.href = '%s%s%s%s';"%s>Next</button>`,
Prefix,
mediaPrefix,
nextPage,
url.QueryEscape(nextPage),
queryParams,
nextStatus))
html.WriteString(fmt.Sprintf(`<button onclick="window.location.href = '%s%s%s%s';"%s>Last</button>`,
Prefix,
mediaPrefix,
last,
url.QueryEscape(last),
queryParams,
lastStatus))