From 3811fb46b3e7997e3228538c64bb8a9e57486c06 Mon Sep 17 00:00:00 2001 From: mpnowacki Date: Sun, 4 Oct 2015 11:34:25 +0200 Subject: [PATCH] fixed file renaming issues with page_file_dir. This will only work with appropriate changes in gollum-lib --- lib/gollum/app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 3fde8bf2..116bc592 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -179,7 +179,7 @@ module Precious halt 500 unless tempfile.is_a? Tempfile # Remove page file dir prefix from upload path if necessary -- committer handles this itself - dir = wiki.per_page_uploads ? params[:upload_dest].match(/^(#{wiki.page_file_dir}\/+)?(.*)/)[2] : 'uploads' + dir = wiki.per_page_uploads ? params[:upload_dest] : ::File.join([wiki.page_file_dir, 'uploads'].compact) ext = ::File.extname(fullname) format = ext.split('.').last || 'txt' filename = ::File.basename(fullname, ext)