merge revision(s) 20121:

* lib/rexml/entity.rb (unnormalized): do not call
	  document.record_entity_expansion if document is nil.
	  see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
	  Thanks, Naohisa Goto.  backported from trunk.
	* test/rexml/test_document.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2009-02-05 00:03:56 +00:00
parent d754218777
commit 1323a6e45c
4 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,12 @@
Thu Feb 5 09:03:21 2009 Shugo Maeda <shugo@ruby-lang.org>
* lib/rexml/entity.rb (unnormalized): do not call
document.record_entity_expansion if document is nil.
see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
Thanks, Naohisa Goto. backported from trunk.
* test/rexml/test_document.rb: ditto.
Thu Feb 5 08:55:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Feb 5 08:55:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_join): do not repeat self in a recursive array. * array.c (rb_ary_join): do not repeat self in a recursive array.

View file

@ -73,7 +73,7 @@ module REXML
# all entities -- both %ent; and &ent; entities. This differs from # all entities -- both %ent; and &ent; entities. This differs from
# +value()+ in that +value+ only replaces %ent; entities. # +value()+ in that +value+ only replaces %ent; entities.
def unnormalized def unnormalized
document.record_entity_expansion document.record_entity_expansion unless document.nil?
v = value() v = value()
return nil if v.nil? return nil if v.nil?
@unnormalized = Text::unnormalize(v, parent) @unnormalized = Text::unnormalize(v, parent)

View file

@ -35,6 +35,7 @@ EOF
<member> <member>
&a; &a;
&a2; &a2;
&lt;
</member> </member>
EOF EOF
@ -53,7 +54,7 @@ EOF
REXML::Document.entity_expansion_limit = 4 REXML::Document.entity_expansion_limit = 4
doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION) doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION)
assert_equal("\na\na a\n", doc.root.children.first.value) assert_equal("\na\na a\n<\n", doc.root.children.first.value)
REXML::Document.entity_expansion_limit = 3 REXML::Document.entity_expansion_limit = 3
doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION) doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION)
assert_raise(RuntimeError) do assert_raise(RuntimeError) do

View file

@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2009-02-05" #define RUBY_RELEASE_DATE "2009-02-05"
#define RUBY_VERSION_CODE 187 #define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20090205 #define RUBY_RELEASE_CODE 20090205
#define RUBY_PATCHLEVEL 106 #define RUBY_PATCHLEVEL 107
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_MINOR 8