diff --git a/common/common.go b/common/common.go index 63c18a78..651caed6 100644 --- a/common/common.go +++ b/common/common.go @@ -66,7 +66,7 @@ var AllowedFileExts = StringList{ "otf", "woff2", "woff", "ttf", "eot", // fonts } var ImageFileExts = StringList{ - "png", "jpg", "jpeg", "svg", "bmp", "gif", "tif", "webp", /* "apng",*/ + "png", "jpg", "jpeg","jfif", "svg", "bmp", "gif", "tif", "webp", /* "apng",*/ } var ArchiveFileExts = StringList{ "bz2", "zip", "gz", "7z", "tar", "cab", diff --git a/common/reply_store.go b/common/reply_store.go index 5bf081a6..23f62211 100644 --- a/common/reply_store.go +++ b/common/reply_store.go @@ -51,8 +51,7 @@ func (s *SQLReplyStore) Get(id int) (*Reply, error) { // TODO: Write a test for this func (s *SQLReplyStore) Create(t *Topic, content string, ip string, uid int) (rid int, err error) { - wcount := WordCount(content) - res, err := s.create.Exec(t.ID, content, ParseMessage(content, t.ParentID, "forums"), ip, wcount, uid) + res, err := s.create.Exec(t.ID, content, ParseMessage(content, t.ParentID, "forums"), ip, WordCount(content), uid) if err != nil { return 0, err } diff --git a/common/thumbnailer.go b/common/thumbnailer.go index a6569afd..c611eef9 100644 --- a/common/thumbnailer.go +++ b/common/thumbnailer.go @@ -47,7 +47,7 @@ func ThumbTask(thumbChan chan bool) { /*if user.RawAvatar == ".gif" { return nil }*/ - if user.RawAvatar != ".png" && user.RawAvatar != ".jpg" && user.RawAvatar != ".jpeg" && user.RawAvatar != ".gif" { + if user.RawAvatar != ".png" && user.RawAvatar != ".jpg" && user.RawAvatar != ".jpeg" && user.RawAvatar != ".jfif" && user.RawAvatar != ".gif" { return nil } diff --git a/routes/topic.go b/routes/topic.go index e2d1cbba..72014cf7 100644 --- a/routes/topic.go +++ b/routes/topic.go @@ -494,7 +494,7 @@ func uploadFilesWithHash(w http.ResponseWriter, r *http.Request, user c.User, di } defer inFile.Close() - if ext != "jpg" && ext != "png" && ext != "gif" { + if ext != "jpg" && ext != "jpeg" && ext != "png" && ext != "gif" { outFile, err := os.Create(dir + filename) if err != nil { return nil, c.LocalError("Upload failed [File Creation Failed]", w, r, user)