From 3b6d093451565c80d36c791ff6ac9cbc5918d287 Mon Sep 17 00:00:00 2001 From: kou Date: Wed, 27 Feb 2013 12:24:31 +0000 Subject: * lib/rexml/security.rb (REXML::Security): create. * lib/rexml/rexml.rb: move entity_expansion_limit and entity_expansion_text_limit accessors to ... * lib/rexml/security.rb: ... here. * lib/rexml/document.rb: use REXML::Security. * lib/rexml/text.rb: use REXML::Security. * test/rexml/test_document.rb: use REXML::Security. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rexml/test_document.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/rexml') diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb index 3ef584c290..cec9452373 100644 --- a/test/rexml/test_document.rb +++ b/test/rexml/test_document.rb @@ -65,24 +65,24 @@ EOF assert_raise(RuntimeError) do doc.root.children.first.value end - REXML::Document.entity_expansion_limit = 100 - assert_equal(100, REXML::Document.entity_expansion_limit) + REXML::Security.entity_expansion_limit = 100 + assert_equal(100, REXML::Security.entity_expansion_limit) doc = REXML::Document.new(XML_WITH_NESTED_ENTITY) assert_raise(RuntimeError) do doc.root.children.first.value end assert_equal(101, doc.entity_expansion_count) - REXML::Document.entity_expansion_limit = 4 + REXML::Security.entity_expansion_limit = 4 doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION) assert_equal("\na\na a\n<\n", doc.root.children.first.value) - REXML::Document.entity_expansion_limit = 3 + REXML::Security.entity_expansion_limit = 3 doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION) assert_raise(RuntimeError) do doc.root.children.first.value end ensure - REXML::Document.entity_expansion_limit = 10000 + REXML::Security.entity_expansion_limit = 10000 end def test_tag_in_cdata_with_not_ascii_only_but_ascii8bit_encoding_source -- cgit v1.2.3