Allow users to upload small archives.

Fix the ordering of functions in topic.Delete.
This commit is contained in:
Azareal 2019-11-01 09:17:26 +10:00
parent f88b8d9777
commit f227aadb6d
2 changed files with 7 additions and 6 deletions

View File

@ -64,12 +64,14 @@ var AllowedFileExts = StringList{
"mp3", "mp4", "avi", "wmv", "webm", // video
"otf", "woff2", "woff", "ttf", "eot", // fonts
"bz2", "zip", "gz", "7z", "tar", "cab","rar", // archives
}
var ImageFileExts = StringList{
"png", "jpg", "jpe","jpeg","jif","jfi","jfif", "svg", "bmp", "gif", "tiff","tif", "webp", /* "apng",*/
}
var ArchiveFileExts = StringList{
"bz2", "zip", "gz", "7z", "tar", "cab",
"bz2", "zip", "gz", "7z", "tar", "cab","rar",
}
var ExecutableFileExts = StringList{
"exe", "jar", "phar", "shar", "iso",

View File

@ -342,16 +342,15 @@ func (t *Topic) Delete() error {
return err
}
err = Forums.RemoveTopic(t.ParentID)
if err != nil && err != ErrNoRows {
return err
}
_, err = topicStmts.delete.Exec(t.ID)
t.cacheRemove()
if err != nil {
return err
}
err = Forums.RemoveTopic(t.ParentID)
if err != nil && err != ErrNoRows {
return err
}
_, err = topicStmts.deleteActivitySubs.Exec(t.ID)
if err != nil {
return err