aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/controllers/request_controller.rb2
-rw-r--r--app/models/foi_attachment.rb2
-rw-r--r--app/views/request/_bubble.rhtml2
4 files changed, 4 insertions, 4 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|
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb
index f3e3d7e00..9bbf0988f 100644
--- a/app/models/foi_attachment.rb
+++ b/app/models/foi_attachment.rb
@@ -42,7 +42,7 @@ class FoiAttachment < ActiveRecord::Base
if rails_env.nil? || rails_env.empty?
raise "$RAILS_ENV is not set"
end
- base_dir = File.join(File.dirname(__FILE__), "../../cache", "attachments_#{rails_env}")
+ base_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../cache", "attachments_#{rails_env}"))
return File.join(base_dir, self.hexdigest[0..2])
end
diff --git a/app/views/request/_bubble.rhtml b/app/views/request/_bubble.rhtml
index 87079e9ea..331c2163e 100644
--- a/app/views/request/_bubble.rhtml
+++ b/app/views/request/_bubble.rhtml
@@ -13,7 +13,7 @@
:file_name => a.display_filename + '.html')
%>
<% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png"
- full_filename = File.join(File.dirname(__FILE__), "../../../public/images", img_filename)
+ full_filename = File.expand_path(File.join(File.dirname(__FILE__), "../../../public/images", img_filename))
if File.exist?(full_filename) %>
<a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>"></a>
<% else %>