From cd590bf1f4f795df92b724efede13a8234705271 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sun, 12 Apr 2015 18:03:55 -0400 Subject: Use `start_with?` instead of String slicing to check for external links [ci skip] --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6aef82354ab..20457572a08 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -240,7 +240,7 @@ module ApplicationHelper # external links def link_to(name = nil, options = nil, html_options = {}) if options.kind_of?(String) - if options[0] != '/' && options[0] != '#' + if !options.start_with?('#', '/') html_options = add_nofollow(options, html_options) end end -- cgit v1.2.1