diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e305e90f4..82884f6c3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -202,7 +202,7 @@ class ApplicationController < ActionController::Base # return stub path so admin can expire it first_three_digits = info_request.id.to_s()[0..2] path = "views/request/#{first_three_digits}/#{info_request.id}" - foi_cache_path = File.join(File.dirname(__FILE__), '../../cache') + foi_cache_path = File.expand_path(File.join(File.dirname(__FILE__), '../../cache')) return File.join(foi_cache_path, path) end def foi_fragment_cache_exists?(key_path) diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 94fbcde29..4592b5ac2 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -839,7 +839,7 @@ class RequestController < ApplicationController ) updated = Digest::SHA1.hexdigest(info_request.get_last_event.created_at.to_i.to_s + info_request.updated_at.to_i.to_s) @url_path = "/download/#{updated[0..1]}/#{updated}/#{params[:url_title]}.zip" - file_path = File.join(File.dirname(__FILE__), '../../cache/zips', @url_path) + file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../cache/zips', @url_path)) if !File.exists?(file_path) FileUtils.mkdir_p(File.dirname(file_path)) Zip::ZipFile.open(file_path, Zip::ZipFile::CREATE) { |zipfile| |