diff options
author | enahum <nahumhbl@gmail.com> | 2017-02-16 06:13:08 -0300 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-02-16 09:13:08 +0000 |
commit | c8cbc3f0f33600ff93cfd97b85082e75e843a28e (patch) | |
tree | 79c12fad2e19d0a7969650fefedec701ce01017a /model | |
parent | 677195641a4148bd65d72bcb7cb5cdff9a47ba79 (diff) | |
download | chat-c8cbc3f0f33600ff93cfd97b85082e75e843a28e.tar.gz chat-c8cbc3f0f33600ff93cfd97b85082e75e843a28e.tar.bz2 chat-c8cbc3f0f33600ff93cfd97b85082e75e843a28e.zip |
(at)-mention preceded by ^, $, # or & to trigger a mention (#5419)
Diffstat (limited to 'model')
-rw-r--r-- | model/utils.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/model/utils.go b/model/utils.go index fcdf5b5cd..08809a47f 100644 --- a/model/utils.go +++ b/model/utils.go @@ -382,7 +382,7 @@ func ClearMentionTags(post string) string { var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`) var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(?:\.[A-Za-z0-9]{3,})?)`) -var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true, '/': true, '\\': true} +var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true, '/': true, '\\': true, '^': true, '#': true, '$': true, '&': true} func IsValidHttpUrl(rawUrl string) bool { if strings.Index(rawUrl, "http://") != 0 && strings.Index(rawUrl, "https://") != 0 { |