summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-12 18:03:55 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-12 18:04:50 -0400
commitcd590bf1f4f795df92b724efede13a8234705271 (patch)
tree4017113adafa78fa2ed17e4b5bb0b09b9b4a66c6
parent975f1e6ec8df4b50118fb3a757c2a4a50a12e98d (diff)
downloadgitlab-ce-cd590bf1f4f795df92b724efede13a8234705271.tar.gz
Use `start_with?` instead of String slicing to check for external links
[ci skip]
-rw-r--r--app/helpers/application_helper.rb2
1 files changed, 1 insertions, 1 deletions
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