From 9953bb50dc1d8c3f8aafd8e86fcf54ae14cec9d2 Mon Sep 17 00:00:00 2001 From: Seednode Date: Tue, 7 Nov 2023 20:04:48 -0600 Subject: [PATCH] URL-encode file paths for first/prev/next/last buttons with sorted files --- cmd/root.go | 2 +- cmd/sort.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index b2ec6b5..b5fc8b0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,7 +12,7 @@ import ( ) const ( - ReleaseVersion string = "3.2.2" + ReleaseVersion string = "3.2.3" ) var ( diff --git a/cmd/sort.go b/cmd/sort.go index e2c2888..44bc441 100644 --- a/cmd/sort.go +++ b/cmd/sort.go @@ -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(``, Prefix, mediaPrefix, - first, + url.QueryEscape(first), queryParams, firstStatus)) html.WriteString(fmt.Sprintf(``, Prefix, mediaPrefix, - prevPage, + url.QueryEscape(prevPage), queryParams, prevStatus)) html.WriteString(fmt.Sprintf(``, Prefix, mediaPrefix, - nextPage, + url.QueryEscape(nextPage), queryParams, nextStatus)) html.WriteString(fmt.Sprintf(``, Prefix, mediaPrefix, - last, + url.QueryEscape(last), queryParams, lastStatus))