mirror of
https://github.com/thomiceli/opengist.git
synced 2025-05-18 09:50:41 +02:00
Fix filename unescape (#474)
This commit is contained in:
parent
5542497622
commit
d796895b75
@ -672,7 +672,7 @@ func convertUTF8ToOctal(name string) string {
|
||||
}
|
||||
|
||||
func convertURLToOctal(name string) string {
|
||||
decoded, err := url.QueryUnescape(name)
|
||||
decoded, err := url.PathUnescape(name)
|
||||
if err != nil {
|
||||
return name
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func ProcessCreate(ctx *context.Context) error {
|
||||
name = "gistfile" + strconv.Itoa(fileCounter) + ".txt"
|
||||
}
|
||||
|
||||
escapedValue, err := url.QueryUnescape(content)
|
||||
escapedValue, err := url.PathUnescape(content)
|
||||
if err != nil {
|
||||
return ctx.ErrorRes(400, ctx.Tr("error.invalid-character-unescaped"), err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user