delete vulnerable AS::SafeBuffer#[]
This commit is contained in:
parent
dcf0964d64
commit
71d8c77e5a
@ -103,12 +103,6 @@ def initialize
|
||||
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)
|
||||
|
@ -113,12 +113,6 @@ def test_titleize
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user