From 5a53c58b048cf48671b64515083cf42eccb7dd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luis=20Leal=20Cardoso=20Junior?= Date: Sat, 5 Dec 2015 23:23:22 -0200 Subject: [PATCH] Sanitize basepath options when adding with more than one / at the start. Fixes #1066 --- bin/gollum | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/gollum b/bin/gollum index 95086016..2513536a 100755 --- a/bin/gollum +++ b/bin/gollum @@ -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)