mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rexml/document.rb: move entity_expansion_limit accessor to ...
* lib/rexml/rexml.rb: ... here for consistency. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ea2e083a1d
commit
b972878978
3 changed files with 28 additions and 5 deletions
|
@ -1,3 +1,12 @@
|
|||
Tue Feb 26 23:32:44 2013 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rexml/document.rb: move entity_expansion_limit accessor to ...
|
||||
* lib/rexml/rexml.rb: ... here for consistency.
|
||||
* lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
|
||||
deprecated.
|
||||
* lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
|
||||
deprecated.
|
||||
|
||||
Tue Feb 26 23:26:13 2013 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rexml/document.rb: move entity_expansion_limit accessor to ...
|
||||
|
|
|
@ -243,16 +243,18 @@ module REXML
|
|||
Parsers::StreamParser.new( source, listener ).parse
|
||||
end
|
||||
|
||||
@@entity_expansion_limit = 10_000
|
||||
|
||||
# Set the entity expansion limit. By default the limit is set to 10000.
|
||||
#
|
||||
# Deprecated. Use REXML.entity_expansion_limit= instead.
|
||||
def Document::entity_expansion_limit=( val )
|
||||
@@entity_expansion_limit = val
|
||||
REXML.entity_expansion_limit = val
|
||||
end
|
||||
|
||||
# Get the entity expansion limit. By default the limit is set to 10000.
|
||||
#
|
||||
# Deprecated. Use REXML.entity_expansion_limit= instead.
|
||||
def Document::entity_expansion_limit
|
||||
return @@entity_expansion_limit
|
||||
return REXML.entity_expansion_limit
|
||||
end
|
||||
|
||||
# Set the entity expansion limit. By default the limit is set to 10240.
|
||||
|
@ -273,7 +275,7 @@ module REXML
|
|||
|
||||
def record_entity_expansion
|
||||
@entity_expansion_count += 1
|
||||
if @entity_expansion_count > @@entity_expansion_limit
|
||||
if @entity_expansion_count > REXML.entity_expansion_limit
|
||||
raise "number of entity expansions exceeded, processing aborted."
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,6 +29,18 @@ module REXML
|
|||
Copyright = COPYRIGHT
|
||||
Version = VERSION
|
||||
|
||||
@@entity_expansion_limit = 10_000
|
||||
|
||||
# Set the entity expansion limit. By default the limit is set to 10000.
|
||||
def self.entity_expansion_limit=( val )
|
||||
@@entity_expansion_limit = val
|
||||
end
|
||||
|
||||
# Get the entity expansion limit. By default the limit is set to 10000.
|
||||
def self.entity_expansion_limit
|
||||
return @@entity_expansion_limit
|
||||
end
|
||||
|
||||
@@entity_expansion_text_limit = 10_240
|
||||
|
||||
# Set the entity expansion limit. By default the limit is set to 10240.
|
||||
|
|
Loading…
Reference in a new issue