From c3e17da8c8ebd101d43ea9185821c44b651535b1 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 28 Apr 2017 10:13:07 -0400 Subject: PLT-6271 Changed word splitting to initially split on any non-name character (#6261) * PLT-6271 Changed word splitting to initially split on any non-name character * Fixed detection of out of channel mentions --- model/utils.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'model') diff --git a/model/utils.go b/model/utils.go index cddf38166..d24540683 100644 --- a/model/utils.go +++ b/model/utils.go @@ -401,8 +401,6 @@ 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, '^': true, '#': true, '$': true, '&': true} - func IsValidHttpUrl(rawUrl string) bool { if strings.Index(rawUrl, "http://") != 0 && strings.Index(rawUrl, "https://") != 0 { return false -- cgit v1.2.3-1-g7c22