Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed Array#inspect to taint result String.
  • Loading branch information
Brian Ford committed Jan 27, 2011
1 parent dfcf219 commit 1ce8667
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel/common/array.rb
Expand Up @@ -998,11 +998,16 @@ def inspect
return "[]" if @total == 0
comma = ", "
result = "["
tainted = false

return "[...]" if Thread.detect_recursion self do
each { |o| result << o.inspect << comma }
each do |o|
result << o.inspect << comma
tainted = o.tainted?
end
end

result.taint if tainted or tainted?
result.shorten!(2)
result << "]"
end
Expand Down

0 comments on commit 1ce8667

Please sign in to comment.