aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-05-09 11:20:19 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-05-09 11:20:19 +0000
commitb167248b21a8da63be871ec6815d117a8efa25f3 (patch)
tree3d977fdddeb85e189406ac4a8e9cb08562795fcf /actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
parent979880dd24d74cd2e99a06eab6c9969a1b5b2ceb (diff)
downloadrails-b167248b21a8da63be871ec6815d117a8efa25f3.tar.gz
rails-b167248b21a8da63be871ec6815d117a8efa25f3.tar.bz2
rails-b167248b21a8da63be871ec6815d117a8efa25f3.zip
Fixed the HTML scanner used by assert_tag where a infinite loop could be caused by a stray less-than sign in the input #1270 [Jamis Buck]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1297 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/vendor/html-scanner/html/node.rb')
-rw-r--r--actionpack/lib/action_controller/vendor/html-scanner/html/node.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
index e6362655e8..edfc57d8b6 100644
--- a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
+++ b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
@@ -277,7 +277,10 @@ module HTML#:nodoc:
"</#{@name}>"
else
s = "<#{@name}"
- @attributes.each { |k,v| s << " #{k}='#{v.to_s.gsub(/'/,"\\\\'")}'" }
+ @attributes.each do |k,v|
+ s << " #{k}"
+ s << "='#{v.gsub(/'/,"\\\\'")}'" if String === v
+ end
s << " /" if @closing == :self
s << ">"
@children.each { |child| s << child.to_s }