mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
API: Improve path and filename parameter sanitation #1814
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
|
||||
"github.com/photoprism/photoprism/pkg/fs"
|
||||
"github.com/photoprism/photoprism/pkg/sanitize"
|
||||
"github.com/photoprism/photoprism/pkg/txt"
|
||||
)
|
||||
|
||||
// TODO: GET /api/v1/dl/file/:hash
|
||||
@@ -56,7 +55,7 @@ func GetDownload(router *gin.RouterGroup) {
|
||||
fileName := photoprism.FileName(f.FileRoot, f.FileName)
|
||||
|
||||
if !fs.FileExists(fileName) {
|
||||
log.Errorf("download: file %s is missing", txt.LogParam(f.FileName))
|
||||
log.Errorf("download: file %s is missing", sanitize.Log(f.FileName))
|
||||
c.Data(404, "image/svg+xml", brokenIconSvg)
|
||||
|
||||
// Set missing flag so that the file doesn't show up in search results anymore.
|
||||
|
||||
Reference in New Issue
Block a user