diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-13 16:42:31 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-13 16:42:31 +0300 |
commit | 82c8c44cac6e3321298c5f595a0672311c395768 (patch) | |
tree | cfd644ba2e15e9feb0b026ccd0cffa98014918f8 /app | |
parent | 3c046cc4e7a463773273407208512bb5009fc9ec (diff) | |
parent | a10f5fadb51ea6c516495c7e92c9527487cbc736 (diff) | |
download | gitlab-ce-82c8c44cac6e3321298c5f595a0672311c395768.tar.gz |
Merge pull request #7312 from hiroponz/fix-404-when-clicking-link-on-hipchat-message
Fix 404 error when clicking the branch link on hipchat message
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project_services/hipchat_service.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb index 48fe365760b..256debffc51 100644 --- a/app/models/project_services/hipchat_service.rb +++ b/app/models/project_services/hipchat_service.rb @@ -59,11 +59,15 @@ class HipchatService < Service message = "" message << "#{push[:user_name]} " if before =~ /000000/ - message << "pushed new branch <a href=\"#{project.web_url}/commits/#{ref}\">#{ref}</a> to <a href=\"#{project.web_url}\">#{project.name_with_namespace.gsub!(/\s/,'')}</a>\n" + message << "pushed new branch <a href=\""\ + "#{project.web_url}/commits/#{URI.escape(ref)}\">#{ref}</a>"\ + " to <a href=\"#{project.web_url}\">"\ + "#{project.name_with_namespace.gsub!(/\s/, "")}</a>\n" elsif after =~ /000000/ message << "removed branch #{ref} from <a href=\"#{project.web_url}\">#{project.name_with_namespace.gsub!(/\s/,'')}</a> \n" else - message << "pushed to branch <a href=\"#{project.web_url}/commits/#{ref}\">#{ref}</a> " + message << "pushed to branch <a href=\""\ + "#{project.web_url}/commits/#{URI.escape(ref)}\">#{ref}</a> " message << "of <a href=\"#{project.web_url}\">#{project.name_with_namespace.gsub!(/\s/,'')}</a> " message << "(<a href=\"#{project.web_url}/compare/#{before}...#{after}\">Compare changes</a>)" |