A file name must not contain '#'
This commit is contained in:
parent
cd9b518284
commit
2f2908e4fe
1 changed files with 1 additions and 0 deletions
1
admin.go
1
admin.go
|
@ -165,6 +165,7 @@ func newHandler(w http.ResponseWriter, r *http.Request) {
|
|||
func ValidFileName(path string, title string, extension string) string {
|
||||
title = strings.Replace(title, "/", "_", -1)
|
||||
title = strings.Replace(title, "?", "_", -1)
|
||||
title = strings.Replace(title, "#", "_", -1)
|
||||
file := path + "/" + title + extension
|
||||
_, err := os.Stat(file)
|
||||
for i := 0; err == nil; i++ {
|
||||
|
|
Reference in a new issue