summaryrefslogtreecommitdiff
path: root/lib/rexml/text.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 12:24:31 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 12:24:31 +0000
commit3b6d093451565c80d36c791ff6ac9cbc5918d287 (patch)
tree1c6a9675ea0eeb169707c4f82997cde3a5f5dca2 /lib/rexml/text.rb
parent20514a08936861205e21c80973b532d6af26c139 (diff)
* 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
Diffstat (limited to 'lib/rexml/text.rb')
-rw-r--r--lib/rexml/text.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
index 7b00b0f104..6624e2a91e 100644
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -1,4 +1,4 @@
-require 'rexml/rexml'
+require 'rexml/security'
require 'rexml/entity'
require 'rexml/doctype'
require 'rexml/child'
@@ -384,7 +384,7 @@ module REXML
sum = 0
string.gsub( /\r\n?/, "\n" ).gsub( REFERENCE ) {
s = Text.expand($&, doctype, filter)
- if sum + s.bytesize > REXML.entity_expansion_text_limit
+ if sum + s.bytesize > Security.entity_expansion_text_limit
raise "entity expansion has grown too large"
else
sum += s.bytesize