Sanitize basepath options when adding with more than one / at the start. Fixes #1066

This commit is contained in:
André Luis Leal Cardoso Junior
2015-12-05 23:23:22 -02:00
parent a61d1e3d10
commit 5a53c58b04
+2 -4
View File
@@ -71,10 +71,8 @@ opts = OptionParser.new do |opts|
"Example: setting this to '/wiki' will make the wiki accessible under 'http://localhost:4567/wiki/'.") do |base_path|
# first trim a leading slash, if any
if base_path.start_with?("/")
base_path = base_path[1..-1]
end
base_path.sub!(/^\/+/, '')
# make a backup of the option and sanitize it
base_path_original = base_path.dup
base_path = CGI.escape(base_path)