WebClient shares: fix view pdf files

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-11-04 12:36:19 +01:00
parent b4d9bf9c16
commit 37facd21d4

View File

@@ -1053,11 +1053,7 @@ func (s *httpdServer) handleShareViewPDF(w http.ResponseWriter, r *http.Request)
if err != nil { if err != nil {
return return
} }
name, err := getBrowsableSharedPath(share, r) name := util.CleanPath(r.URL.Query().Get("path"))
if err != nil {
s.renderClientMessagePage(w, r, "Invalid share path", "", getRespStatus(err), err, "")
return
}
data := viewPDFPage{ data := viewPDFPage{
Title: path.Base(name), Title: path.Base(name),
URL: fmt.Sprintf("%s?path=%s&_=%d", path.Join(webClientPubSharesPath, share.ShareID, "getpdf"), URL: fmt.Sprintf("%s?path=%s&_=%d", path.Join(webClientPubSharesPath, share.ShareID, "getpdf"),