ruby-changes:27925
From: usa <ko1@a...>
Date: Thu, 28 Mar 2013 18:13:02 +0900 (JST)
Subject: [ruby-changes:27925] usa:r39977 (ruby_1_9_3): merge revision(s) 39509,39511: [Backport #7961]
usa 2013-03-28 18:12:42 +0900 (Thu, 28 Mar 2013) New Revision: 39977 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39977 Log: merge revision(s) 39509,39511: [Backport #7961] * lib/rexml/document.rb: move entity_expansion_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_limit): deprecated. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated. * lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961] * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ... * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit): * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=): REXML.entity_expansion_text_limit. Modified directories: branches/ruby_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/lib/rexml/document.rb branches/ruby_1_9_3/lib/rexml/rexml.rb branches/ruby_1_9_3/lib/rexml/text.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 39976) +++ ruby_1_9_3/ChangeLog (revision 39977) @@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Thu Mar 28 18:12:19 2013 Kouhei Sutou <kou@c...> + + * 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@r...> * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): Index: ruby_1_9_3/lib/rexml/document.rb =================================================================== --- ruby_1_9_3/lib/rexml/document.rb (revision 39976) +++ ruby_1_9_3/lib/rexml/document.rb (revision 39977) @@ -217,16 +217,18 @@ module REXML https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/rexml/document.rb#L217 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 Index: ruby_1_9_3/lib/rexml/text.rb =================================================================== --- ruby_1_9_3/lib/rexml/text.rb (revision 39976) +++ ruby_1_9_3/lib/rexml/text.rb (revision 39977) @@ -1,3 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/rexml/text.rb#L1 +require 'rexml/rexml' require 'rexml/entity' require 'rexml/doctype' require 'rexml/child' @@ -383,7 +384,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/rexml/text.rb#L384 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 Index: ruby_1_9_3/lib/rexml/rexml.rb =================================================================== --- ruby_1_9_3/lib/rexml/rexml.rb (revision 39976) +++ ruby_1_9_3/lib/rexml/rexml.rb (revision 39977) @@ -28,4 +28,16 @@ module REXML https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/rexml/rexml.rb#L28 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 Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 39976) +++ ruby_1_9_3/version.h (revision 39977) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #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" Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r39509,39511 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/