[PATCH links] Allow pipe characters in tags.
Export this patch
Don't try to save tags longer than 50 chars.
Changelog-fixed: Issue saving tags longer than 50 chars (not allowed)
Changelog-updated: Allow tags with pipe symbols
---
helpers.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/helpers.go b/helpers.go
index 9ce16dc..7d30e3f 100644
--- a/helpers.go
+++ b/helpers.go
@@ -747,6 +747,9 @@ func ProcessTags(ctx context.Context, tags []string) ([]int, error) {
tag := strings.TrimSpace(tag)
if tag != "" {
slug := Slugify(tag)
+ if len(tag) > 50 || len(slug) > 50 {
+ continue
+ }
Tag := &models.Tag{
Name: tag,
Slug: slug,
@@ -869,6 +872,7 @@ func ParseSearch(s string) string {
if len(word) > 0 {
word = strings.TrimSpace(word)
word = strings.Replace(word, ":", "\\:", -1)
+ word = strings.Replace(word, "|", "\\|", -1)
if !strings.HasPrefix(word, "-") {
word = word + ":*"
}
--
2.47.2
Applied.
To git@git.code.netlandish.com:~netlandish/links
2693ad9..dbf83fe master -> master