ruby-changes:27900
From: nagachika <ko1@a...>
Date: Wed, 27 Mar 2013 02:54:53 +0900 (JST)
Subject: [ruby-changes:27900] nagachika:r39952 (ruby_2_0_0): merge revision(s) 39509,39511: [Backport #7961]
nagachika 2013-03-27 02:54:43 +0900 (Wed, 27 Mar 2013) New Revision: 39952 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39952 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_2_0_0/ Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/lib/rexml/document.rb branches/ruby_2_0_0/lib/rexml/rexml.rb branches/ruby_2_0_0/lib/rexml/text.rb branches/ruby_2_0_0/version.h Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 39951) +++ ruby_2_0_0/ChangeLog (revision 39952) @@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Wed Mar 27 02:53:53 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] + Wed Mar 27 02:50:45 2013 Shugo Maeda <shugo@r...> * object.c (Init_Object): remove Module#used, which has been Index: ruby_2_0_0/lib/rexml/document.rb =================================================================== --- ruby_2_0_0/lib/rexml/document.rb (revision 39951) +++ ruby_2_0_0/lib/rexml/document.rb (revision 39952) @@ -255,16 +255,18 @@ module REXML https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rexml/document.rb#L255 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 10240. + # + # 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_2_0_0/lib/rexml/text.rb =================================================================== --- ruby_2_0_0/lib/rexml/text.rb (revision 39951) +++ ruby_2_0_0/lib/rexml/text.rb (revision 39952) @@ -1,3 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/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_2_0_0/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_2_0_0/lib/rexml/rexml.rb =================================================================== --- ruby_2_0_0/lib/rexml/rexml.rb (revision 39951) +++ ruby_2_0_0/lib/rexml/rexml.rb (revision 39952) @@ -28,4 +28,16 @@ module REXML https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/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_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 39951) +++ ruby_2_0_0/version.h (revision 39952) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-03-27" -#define RUBY_PATCHLEVEL 97 +#define RUBY_PATCHLEVEL 98 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 3 Property changes on: ruby_2_0_0 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r39509,39511 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/