diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | lib/rexml/document.rb | 10 | ||||
-rw-r--r-- | lib/rexml/rexml.rb | 12 | ||||
-rw-r--r-- | lib/rexml/text.rb | 3 | ||||
-rw-r--r-- | version.h | 6 |
5 files changed, 36 insertions, 8 deletions
@@ -1,3 +1,16 @@ +Thu Mar 28 18:12:19 2013 Kouhei Sutou <kou@cozmixng.org> + + * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ... + * lib/rexml/rexml.rb: ... here to make rexml/text independent from + REXML::Document. It causes circular require. + * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit): + deprecated. + * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=): + deprecated. + * lib/rexml/text.rb: add missing require "rexml/rexml" for + REXML.entity_expansion_text_limit. + Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961] + Thu Mar 21 20:34:52 2013 NAKAMURA Usaku <usa@ruby-lang.org> * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb index f15c1bd762..b945a5b76c 100644 --- a/lib/rexml/document.rb +++ b/lib/rexml/document.rb @@ -217,16 +217,18 @@ module REXML return @@entity_expansion_limit end - @@entity_expansion_text_limit = 10_240 - # Set the entity expansion limit. By default the limit is set to 10240. + # + # Deprecated. Use REXML.entity_expansion_text_limit= instead. def Document::entity_expansion_text_limit=( val ) - @@entity_expansion_text_limit = val + REXML.entity_expansion_text_limit = val end # Get the entity expansion limit. By default the limit is set to 10000. + # + # Deprecated. Use REXML.entity_expansion_text_limit instead. def Document::entity_expansion_text_limit - return @@entity_expansion_text_limit + return REXML.entity_expansion_text_limit end attr_reader :entity_expansion_count diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb index f89951171a..bc59a30c64 100644 --- a/lib/rexml/rexml.rb +++ b/lib/rexml/rexml.rb @@ -28,4 +28,16 @@ module REXML Copyright = COPYRIGHT Version = VERSION + + @@entity_expansion_text_limit = 10_240 + + # Set the entity expansion limit. By default the limit is set to 10240. + def self.entity_expansion_text_limit=( val ) + @@entity_expansion_text_limit = val + end + + # Get the entity expansion limit. By default the limit is set to 10240. + def self.entity_expansion_text_limit + return @@entity_expansion_text_limit + end end diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb index 878d13b8e8..7b00b0f104 100644 --- a/lib/rexml/text.rb +++ b/lib/rexml/text.rb @@ -1,3 +1,4 @@ +require 'rexml/rexml' require 'rexml/entity' require 'rexml/doctype' require 'rexml/child' @@ -383,7 +384,7 @@ module REXML sum = 0 string.gsub( /\r\n?/, "\n" ).gsub( REFERENCE ) { s = Text.expand($&, doctype, filter) - if sum + s.bytesize > Document.entity_expansion_text_limit + if sum + s.bytesize > REXML.entity_expansion_text_limit raise "entity expansion has grown too large" else sum += s.bytesize @@ -1,10 +1,10 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 394 +#define RUBY_PATCHLEVEL 395 -#define RUBY_RELEASE_DATE "2013-03-21" +#define RUBY_RELEASE_DATE "2013-03-28" #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 3 -#define RUBY_RELEASE_DAY 21 +#define RUBY_RELEASE_DAY 28 #include "ruby/version.h" |