summaryrefslogtreecommitdiffstats
path: root/model/utils.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-03-07 12:36:40 -0600
committerGitHub <noreply@github.com>2018-03-07 12:36:40 -0600
commite8943936c51450540a4f2e8e7a2f3a2af90d14db (patch)
treebc7d32557780a2235a4f9a878d3b0841a1df0bda /model/utils.go
parentfd9ee780ed713c10f122f9eb83e07bfdf09ce4a4 (diff)
downloadchat-e8943936c51450540a4f2e8e7a2f3a2af90d14db.tar.gz
chat-e8943936c51450540a4f2e8e7a2f3a2af90d14db.tar.bz2
chat-e8943936c51450540a4f2e8e7a2f3a2af90d14db.zip
general cleanup (#8387)
Diffstat (limited to 'model/utils.go')
-rw-r--r--model/utils.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/model/utils.go b/model/utils.go
index 331a1aaaa..72369852b 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -394,9 +394,6 @@ func ClearMentionTags(post string) string {
return post
}
-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(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(?:\.[A-Za-z0-9]{3,})?)`)
-
func IsValidHttpUrl(rawUrl string) bool {
if strings.Index(rawUrl, "http://") != 0 && strings.Index(rawUrl, "https://") != 0 {
return false
@@ -409,18 +406,6 @@ func IsValidHttpUrl(rawUrl string) bool {
return true
}
-func IsValidHttpsUrl(rawUrl string) bool {
- if strings.Index(rawUrl, "https://") != 0 {
- return false
- }
-
- if _, err := url.ParseRequestURI(rawUrl); err != nil {
- return false
- }
-
- return true
-}
-
func IsValidTurnOrStunServer(rawUri string) bool {
if strings.Index(rawUri, "turn:") != 0 && strings.Index(rawUri, "stun:") != 0 {
return false