Compare commits

...

2 Commits

Author SHA1 Message Date
wr00t 24b35f4df7
Merge 06f9270446 into 8e79294413 2023-09-18 13:58:49 +08:00
wr00t 06f9270446 fix Chinese attachment filename
fix the bug of Chinese attachment filename encoding error.
2022-10-20 23:13:39 +08:00
1 changed files with 2 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package models
import (
"encoding/base64"
"crypto/rand"
"errors"
"fmt"
@ -358,6 +359,7 @@ func addAttachment(msg *gomail.Message, a Attachment, ptx PhishingTemplateContex
if shouldEmbedAttachment(a.Name) {
msg.Embed(a.Name, copyFunc)
} else {
a.Name = "=?UTF-8?B?" + base64.StdEncoding.EncodeToString([]byte(a.Name)) + "?="
msg.Attach(a.Name, copyFunc)
}
}