Remove '?' from filenames
This commit is contained in:
parent
4b30b5c091
commit
3d69ce8e03
1 changed files with 1 additions and 0 deletions
1
admin.go
1
admin.go
|
@ -142,6 +142,7 @@ func newHandler(coll *mgo.Collection) func(http.ResponseWriter, *http.Request) {
|
|||
|
||||
func ValidFileName(path string, title string, extension string) string {
|
||||
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