diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-06-03 14:28:43 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-06-03 14:28:43 +0100 |
commit | 0806fcc7d477b45d158e8a152b1f927f395d3aa7 (patch) | |
tree | 3fc0d5028a42c3a9f7971a349d67d90ab071a223 /app/views | |
parent | 775e122cb4824c9734f50db0dd2967779636080e (diff) |
File.dirname(__FILE__) is not necessarily absolute
It’s weird that there’s so much code here that implicitly
assumes File.dirname(__FILE__) is an absolute path, because
really in general it very much is not! This assumption was
invalidated by the recent bundler-awareness changes.
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/request/_bubble.rhtml | 2 |
1 files changed, 1 insertions, 1 deletions
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 %> |