Photos: Refactor link from the Files tab to the file folder #2926

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2023-06-13 15:57:02 +02:00
parent 9e316a2ec0
commit 53aeaffe0e
7 changed files with 37 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ func Path(s string) string {
}
switch r {
case '~', '\\', ':', '|', '"', '?', '*', '<', '>', '{', '}':
case '~', '\\', '|', '"', '?', '*', '<', '>', '{', '}':
return -1
default:
return r
@@ -38,7 +38,7 @@ func UserPath(dir string) string {
return dir
}
dir = strings.Trim(path.Clean(Path(strings.ReplaceAll(dir, "\\", "/"))), "./ \\*%#~?|<>:")
dir = strings.Trim(path.Clean(Path(strings.ReplaceAll(dir, "\\", "/"))), "./ \\*%#~?|<>")
if strings.Contains(dir, "/.") || strings.Contains(dir, "..") || strings.Contains(dir, "//") {
return ""