#3393 fix missing sub-url prefix in relative avatar link

This commit is contained in:
Unknwon 2016-08-07 10:13:05 -07:00
parent 2772791fda
commit ec92565f23
8 changed files with 32 additions and 27 deletions

File diff suppressed because one or more lines are too long

View file

@ -334,6 +334,7 @@ func NewContext() {
log.Fatal(4, "Invalid ROOT_URL '%s': %s", AppUrl, err)
}
// Suburl should start with '/' and end without '/', such as '/{subpath}'.
// This value is empty if site does not have sub-url.
AppSubUrl = strings.TrimSuffix(url.Path, "/")
AppSubUrlDepth = strings.Count(AppSubUrl, "/")