Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-18 00:23:16 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-06-18 00:23:16 +0300
commit54365ecc7aefede64f73fa36acd651336ffa095f (patch)
tree03cfb9c5654316b514256f81c3d96d87fe55b16f /app/helpers
parente12b643192a945f5ff40da3dd1883616ae04e8d9 (diff)
Remove overridden `link_to` helper
The purpose for this override is now handled by `ExternalLinkFilter`.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb33
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