aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-09-04 20:43:38 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-09-04 20:43:38 +0000
commitbf8b101dd65eb261644c67fdc0e40bf54b9f2564 (patch)
tree10995980fbc33a5fe249aec8291891f6c2bb779c /actionpack/lib/action_view/helpers
parent4fdddc331ed8236c3c0a892c20a42c03b9584e16 (diff)
downloadrails-bf8b101dd65eb261644c67fdc0e40bf54b9f2564.tar.gz
rails-bf8b101dd65eb261644c67fdc0e40bf54b9f2564.tar.bz2
rails-bf8b101dd65eb261644c67fdc0e40bf54b9f2564.zip
Fixed that AssetTagHelper#image_tag and others using compute_public_path should not modify the incoming source argument (closes #5102) [eule@space.ch]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5003 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 1f48ab224d..d31b42b565 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -158,6 +158,7 @@ module ActionView
private
def compute_public_path(source, dir, ext)
+ source = source.dup
source = "/#{dir}/#{source}" unless source.first == "/" || source.include?(":")
source << ".#{ext}" unless source.split("/").last.include?(".")
source << '?' + rails_asset_id(source) if defined?(RAILS_ROOT) && %r{^[-a-z]+://} !~ source