prevent viewing history for unknown articles

This commit is contained in:
mappu 2017-08-13 17:58:01 +12:00
parent 884acd3040
commit d937ea6562

View File

@ -20,6 +20,11 @@ func (this *WikiServer) routeHistory(w http.ResponseWriter, r *http.Request, art
return return
} }
if len(revs) == 0 {
this.serveErrorHTMLMessage(w, this.noSuchArticleError(articleTitle))
return
}
pto := DefaultPageTemplateOptions(this.opts) pto := DefaultPageTemplateOptions(this.opts)
pto.CurrentPageName = articleTitle pto.CurrentPageName = articleTitle
pto.CurrentPageIsArticle = true pto.CurrentPageIsArticle = true