diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 12:26:41 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 12:26:41 +0200 |
commit | 6c4d48b8b9219941218b5abdbf95acc10ff54dea (patch) | |
tree | 005f75beed45d24476c7092f7dff85536a317f24 /app | |
parent | 9179dc6dc80a5178f4b1de9373b9e4c764485304 (diff) | |
parent | 54365ecc7aefede64f73fa36acd651336ffa095f (diff) | |
download | gitlab-ce-6c4d48b8b9219941218b5abdbf95acc10ff54dea.tar.gz |
Merge branch 'rs-remove-link-to-override'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Conflicts:
spec/helpers/application_helper_spec.rb
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c1342331119..9889c995c74 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -233,39 +233,6 @@ module ApplicationHelper Gitlab::MarkupHelper.asciidoc?(filename) end - # Overrides ActionView::Helpers::UrlHelper#link_to to add `rel="nofollow"` to - # external links - def link_to(name = nil, options = nil, html_options = {}) - if options.kind_of?(String) - if !options.start_with?('#', '/') - html_options = add_nofollow(options, html_options) - end - end - - super - end - - # Add `"rel=nofollow"` to external links - # - # link - String link to check - # html_options - Hash of `html_options` passed to `link_to` - # - # Returns `html_options`, adding `rel: nofollow` for external links - def add_nofollow(link, html_options = {}) - begin - uri = URI(link) - - if uri && uri.absolute? && uri.host != Gitlab.config.gitlab.host - rel = html_options.fetch(:rel, '') - html_options[:rel] = (rel + ' nofollow').strip - end - rescue URI::Error - # noop - end - - html_options - end - def promo_host 'about.gitlab.com' end |