aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2017-06-19 02:39:36 +0000
committerFelix Hanley <felix@userspace.com.au>2017-06-19 02:39:36 +0000
commit3c1f5a701982383d57a4e14add182a2ce6f5c18d (patch)
treeb7e402cda423e098ed6876e355d499ee2c3e4e13
parent28cef407970b23af1873f041d92117f759938fb8 (diff)
downloaddhtsearch-3c1f5a701982383d57a4e14add182a2ce6f5c18d.tar.gz
dhtsearch-3c1f5a701982383d57a4e14add182a2ce6f5c18d.tar.bz2
Require character class tags to have at least 3 characters
-rw-r--r--http.go2
-rw-r--r--tag.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/http.go b/http.go
index 9f3e673..c950f0a 100644
--- a/http.go
+++ b/http.go
@@ -233,7 +233,7 @@ var search = function (term, page) {
].join('')
}).join('')
var post = [
- '</ul><p>'
+ '</ul><p>',
(data.page > 1) ? '<a class="pager prev" href="#">Previous</a>&nbsp;' : '',
(data.torrents.length === data.page_size) ? '<a class="pager next" href="#">Next</a>' : '',
'</p>'].join('')
diff --git a/tag.go b/tag.go
index 4191962..49859b7 100644
--- a/tag.go
+++ b/tag.go
@@ -43,7 +43,8 @@ func initTagRegexps() {
continue
}
className := strings.ToLower(cc)
- tagREs[className] = regexp.MustCompile(fmt.Sprintf(`(?i)\p{%s}`, cc))
+ // Test for 3 or more characters per character class
+ tagREs[className] = regexp.MustCompile(fmt.Sprintf(`(?i)\p{%s}{3,}`, cc))
}
// Merge user tags
for tag, re := range Config.Tags {