summaryrefslogtreecommitdiffstats
path: root/model/utils.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-07-21 19:21:05 -0400
committerJoramWilander <jwawilander@gmail.com>2015-07-21 19:23:00 -0400
commitb821d23ed71c89b14aa294debcf390057de27b37 (patch)
tree10b0da76d799d952f32d058550fa5cfb5fda7422 /model/utils.go
parent39abf24708870cec71a84c01063e647b859b2b67 (diff)
downloadchat-b821d23ed71c89b14aa294debcf390057de27b37.tar.gz
chat-b821d23ed71c89b14aa294debcf390057de27b37.tar.bz2
chat-b821d23ed71c89b14aa294debcf390057de27b37.zip
fixed unit tests to work with team domain changes and update partial url regex for files
Diffstat (limited to 'model/utils.go')
-rw-r--r--model/utils.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/model/utils.go b/model/utils.go
index 38592b984..093a54e38 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -319,6 +319,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+_~\-\.%=&amp;]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`)
-var PartialUrlRegex = regexp.MustCompile(`/api/v1/files/(get|get_image)/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/(([A-Za-z0-9]+/)?.+\.[A-Za-z0-9]{3,})`)
+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}