mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Library: Trim "~" at the beginning and end of path names #3695
On Unix-like OS, this is a placeholder for the user's home directory. Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -38,7 +38,7 @@ func UserPath(dir string) string {
|
|||||||
return dir
|
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, "//") {
|
if strings.Contains(dir, "/.") || strings.Contains(dir, "..") || strings.Contains(dir, "//") {
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
Reference in New Issue
Block a user