diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-17 17:23:16 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-17 17:23:16 -0400 |
commit | 54365ecc7aefede64f73fa36acd651336ffa095f (patch) | |
tree | 03cfb9c5654316b514256f81c3d96d87fe55b16f /app/helpers | |
parent | e12b643192a945f5ff40da3dd1883616ae04e8d9 (diff) | |
download | gitlab-ce-54365ecc7aefede64f73fa36acd651336ffa095f.tar.gz |
Remove overridden `link_to` helperrs-remove-link-to-override
The purpose for this override is now handled by `ExternalLinkFilter`.
Diffstat (limited to 'app/helpers')
-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 10d7aa11209..5627aba00fb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -214,39 +214,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 |