mirror of
https://github.com/makew0rld/amfora.git
synced 2025-02-02 15:07:34 -05:00
🐛 Don't crash if subbed page matches user dir pattern but doesn't have more
Fixes #157
This commit is contained in:
parent
b50347177b
commit
6e3e8a0584
@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.7.2] - 2020-12-21
|
||||||
|
### Fixed
|
||||||
|
- Viewing subscriptions after subscribing to a certain user page won't crash Amfora (#157)
|
||||||
|
|
||||||
|
|
||||||
## [1.7.1] - 2020-12-21
|
## [1.7.1] - 2020-12-21
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed bug that caused Amfora to crash when subscribing to a page (#151)
|
- Fixed bug that caused Amfora to crash when subscribing to a page (#151)
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version = "v1.7.1"
|
version = "v1.7.2"
|
||||||
commit = "unknown"
|
commit = "unknown"
|
||||||
builtBy = "unknown"
|
builtBy = "unknown"
|
||||||
)
|
)
|
||||||
|
@ -112,14 +112,14 @@ func GetPageEntries() *PageEntries {
|
|||||||
|
|
||||||
// Path is title
|
// Path is title
|
||||||
title := parsed.Path
|
title := parsed.Path
|
||||||
if strings.HasPrefix(title, "/~") {
|
if strings.HasPrefix(title, "/~") && title != "/~" {
|
||||||
// A user dir
|
// A user dir
|
||||||
title = title[2:] // Remove beginning slash and tilde
|
title = title[2:] // Remove beginning slash and tilde
|
||||||
// Remove trailing slash if the root of a user dir is being tracked
|
// Remove trailing slash if the root of a user dir is being tracked
|
||||||
if strings.Count(title, "/") <= 1 && title[len(title)-1] == '/' {
|
if strings.Count(title, "/") <= 1 && title[len(title)-1] == '/' {
|
||||||
title = title[:len(title)-1]
|
title = title[:len(title)-1]
|
||||||
}
|
}
|
||||||
} else if strings.HasPrefix(title, "/users/") {
|
} else if strings.HasPrefix(title, "/users/") && title != "/users/" {
|
||||||
// "/users/" is removed for aesthetics when tracking hosted users
|
// "/users/" is removed for aesthetics when tracking hosted users
|
||||||
title = strings.TrimPrefix(title, "/users/")
|
title = strings.TrimPrefix(title, "/users/")
|
||||||
title = strings.TrimPrefix(title, "~") // Remove leading tilde
|
title = strings.TrimPrefix(title, "~") // Remove leading tilde
|
||||||
|
Loading…
x
Reference in New Issue
Block a user