lib/gollum/frontend/app.rb in gollum-2.1.4 vs lib/gollum/frontend/app.rb in gollum-2.1.6

- old
+ new

@@ -134,11 +134,11 @@ raw_data = page.raw_data @content = raw_data.respond_to?(:force_encoding) ? raw_data.force_encoding('UTF-8') : raw_data mustache :edit end else - redirect to("/create/#{CGI.escape(@name)}") + redirect to("/create/#{encodeURIComponent(@name)}") end end post '/edit/*' do wikip = wiki_page(CGI.unescape(params[:page]), sanitize_empty_params(params[:path])) @@ -170,11 +170,11 @@ redirect to('/') end get '/create/*' do - wikip = wiki_page(params[:splat].first) + wikip = wiki_page(params[:splat].first.gsub('+', '-')) @name = wikip.name.to_url @path = wikip.path page = wikip.page if page @@ -352,10 +352,10 @@ elsif file = wiki.file(fullpath) content_type file.mime_type file.raw_data else page_path = [path, name].compact.join('/') - redirect to("/create/#{CGI.escape(page_path).gsub('%2F','/')}") + redirect to("/create/#{encodeURIComponent(page_path).gsub('%2F','/')}") end end def update_wiki_page(wiki, page, content, commit, name = nil, format = nil) return if !page ||