Merge pull request #1098 from andrehjr/gh-1066-sanitize-basepath

Sanitize basepath options when adding with more than one / at the start Fixes #1066.
This commit is contained in:
Dawa Ometto
2015-12-30 18:39:30 +01:00
+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)