mirror of
https://github.com/github/rails.git
synced 2026-01-10 15:18:13 -05:00
delete vulnerable AS::SafeBuffer#[]
This commit is contained in:
committed by
Aaron Patterson
parent
42fabd2366
commit
dfa33fa3da
@@ -98,12 +98,6 @@ module ActiveSupport #:nodoc:
|
||||
end
|
||||
end
|
||||
|
||||
def[](*args)
|
||||
new_safe_buffer = super
|
||||
new_safe_buffer.instance_eval { @dirty = false }
|
||||
new_safe_buffer
|
||||
end
|
||||
|
||||
def safe_concat(value)
|
||||
raise SafeConcatError if dirty?
|
||||
original_concat(value)
|
||||
|
||||
@@ -111,12 +111,6 @@ class SafeBufferTest < ActiveSupport::TestCase
|
||||
assert_kind_of NilClass, @buffer.slice("chipchop")
|
||||
end
|
||||
|
||||
test "Should initialize @dirty to false for new instance when sliced" do
|
||||
dirty = @buffer[0,0].send(:dirty?)
|
||||
assert_not_nil dirty
|
||||
assert !dirty
|
||||
end
|
||||
|
||||
test "clone_empty returns an empty buffer" do
|
||||
assert_equal '', ActiveSupport::SafeBuffer.new('foo').clone_empty
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user