summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-10-21 11:38:41 +0200
committerMarin Jankovski <maxlazio@gmail.com>2014-10-21 11:38:41 +0200
commitce61de68ba43bd59dcec607dddae49591459bf93 (patch)
treebc05f995565001d9e86476bddf5cbba62651b44b
parentcccfede34cac854b4a6cbbe64d83647ee0c0af35 (diff)
downloadgitlab-ce-ce61de68ba43bd59dcec607dddae49591459bf93.tar.gz
Use allowed slack team name.
-rw-r--r--app/models/project_services/slack_service.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/project_services/slack_service.rb b/app/models/project_services/slack_service.rb
index 95f3ddcef45..837002ef3c8 100644
--- a/app/models/project_services/slack_service.rb
+++ b/app/models/project_services/slack_service.rb
@@ -40,7 +40,8 @@ class SlackService < Service
project_name: project_name
))
- credentials = webhook.match(/(\w*).slack.com.*services\/(.*)/)
+ credentials = webhook.match(/([\w-]*).slack.com.*services\/(.*)/)
+
if credentials.present?
subdomain = credentials[1]
token = credentials[2].split("token=").last