BigW Consortium Gitlab

Commit cd590bf1 by Robert Speicher

Use `start_with?` instead of String slicing to check for external links

[ci skip]
parent 975f1e6e
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment