Skip to content

Commit

Permalink
urlencode generated filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Nov 20, 2014
1 parent bb9b8b0 commit 5029d0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/post/image_store/local2.rb
Expand Up @@ -33,7 +33,7 @@ def base_url(type = :files)

def file_url
if CONFIG["use_pretty_image_urls"] then
"#{base_url}/image/#{md5}/#{pretty_file_name}.#{file_ext}"
"#{base_url}/image/#{md5}/#{url_encode pretty_file_name}.#{file_ext}"
else
"#{base_url}/data/image/#{file_hierarchy}/#{file_name}"
end
Expand All @@ -51,15 +51,15 @@ def preview_url

def store_jpeg_url
if CONFIG["use_pretty_image_urls"] then
"#{base_url}/jpeg/#{md5}/#{pretty_file_name(:type => :jpeg)}.jpg"
"#{base_url}/jpeg/#{md5}/#{url_encode pretty_file_name(:type => :jpeg)}.jpg"
else
"#{base_url}/data/jpeg/#{file_hierarchy}/#{md5}.jpg"
end
end

def store_sample_url
if CONFIG["use_pretty_image_urls"] then
"#{base_url}/sample/#{md5}/#{pretty_file_name(:type => :sample)}.jpg"
"#{base_url}/sample/#{md5}/#{url_encode pretty_file_name(:type => :sample)}.jpg"
else
"#{base_url}/data/sample/#{file_hierarchy}/" + CONFIG["sample_filename_prefix"] + "#{md5}.jpg"
end
Expand Down

0 comments on commit 5029d0f

Please sign in to comment.