Fix #542
Page link may contain duplicate starting forward slashes. //page points to http://page/ when what we want is /page pointing to http://localhost:1234/page
This commit is contained in:
@@ -407,6 +407,12 @@ module Gollum
|
||||
presence = "present"
|
||||
end
|
||||
link = ::File.join(@wiki.base_path, page ? page.escaped_url_path : CGI.escape(link_name))
|
||||
|
||||
# //page is invalid
|
||||
# strip all duplicate forward slashes using helpers.rb clean_url
|
||||
# //page => /page
|
||||
link = clean_url link
|
||||
|
||||
%{<a class="internal #{presence}" href="#{link}#{extra}">#{name}</a>}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user