API: Improve path and filename parameter sanitation #1814

This commit is contained in:
Michael Mayer
2021-12-14 20:01:39 +01:00
parent cce371d35a
commit 0f0c0aaa0b
100 changed files with 683 additions and 452 deletions

View File

@@ -17,7 +17,7 @@ import (
"github.com/photoprism/photoprism/internal/photoprism"
"github.com/photoprism/photoprism/internal/service"
"github.com/photoprism/photoprism/pkg/fs"
"github.com/photoprism/photoprism/pkg/txt"
"github.com/photoprism/photoprism/pkg/sanitize"
)
// BackupCommand configures the backup cli command.
@@ -113,7 +113,7 @@ func backupAction(ctx *cli.Context) error {
}
}
log.Infof("backing up database to %s", txt.LogParam(indexFileName))
log.Infof("backing up database to %s", sanitize.Log(indexFileName))
}
var cmd *exec.Cmd
@@ -175,7 +175,7 @@ func backupAction(ctx *cli.Context) error {
albumsPath = conf.AlbumsPath()
}
log.Infof("backing up albums to %s", txt.LogParam(albumsPath))
log.Infof("backing up albums to %s", sanitize.Log(albumsPath))
if count, err := photoprism.BackupAlbums(albumsPath, true); err != nil {
return err