mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-17 11:52:27 +08:00
fix out of range about MapArticels
This commit is contained in:
4
front.go
4
front.go
@@ -119,8 +119,8 @@ func HandleArchivesPage(c *gin.Context) {
|
|||||||
|
|
||||||
func HandleArticlePage(c *gin.Context) {
|
func HandleArticlePage(c *gin.Context) {
|
||||||
path := c.Param("slug")
|
path := c.Param("slug")
|
||||||
artc := Ei.MapArticles[path[0:strings.Index(path, ".")]]
|
index := strings.Index(path, ".")
|
||||||
if artc == nil {
|
if index < 0 || Ei.MapArticles[path[0:index]] == nil {
|
||||||
HandleNotFound(c)
|
HandleNotFound(c)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user