From 284dc8effcf9914e944a3f386a38b49b56a8012d Mon Sep 17 00:00:00 2001 From: shyouhei Date: Thu, 5 Feb 2009 00:02:52 +0000 Subject: merge revision(s) 20121: * lib/rexml/entity.rb (unnormalized): do not call document.record_entity_expansion if document is nil. see . 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_6@22060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ lib/rexml/entity.rb | 2 +- test/rexml/test_document.rb | 3 ++- version.h | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82ef7eac8b..784fe14892 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Feb 5 09:02:18 2009 Shugo Maeda + + * lib/rexml/entity.rb (unnormalized): do not call + document.record_entity_expansion if document is nil. + see . + Thanks, Naohisa Goto. backported from trunk. + + * test/rexml/test_document.rb: ditto. + Thu Feb 5 08:54:25 2009 Nobuyoshi Nakada * array.c (rb_ary_join): do not repeat self in a recursive array. diff --git a/lib/rexml/entity.rb b/lib/rexml/entity.rb index 94e6d3ff1b..7e9b4e5e1a 100644 --- a/lib/rexml/entity.rb +++ b/lib/rexml/entity.rb @@ -73,7 +73,7 @@ module REXML # all entities -- both %ent; and &ent; entities. This differs from # +value()+ in that +value+ only replaces %ent; entities. def unnormalized - document.record_entity_expansion + document.record_entity_expansion unless document.nil? v = value() return nil if v.nil? @unnormalized = Text::unnormalize(v, parent) diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb index 5207b42d72..0261e80b74 100644 --- a/test/rexml/test_document.rb +++ b/test/rexml/test_document.rb @@ -35,6 +35,7 @@ EOF &a; &a2; +< EOF @@ -53,7 +54,7 @@ EOF REXML::Document.entity_expansion_limit = 4 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 doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION) assert_raise(RuntimeError) do diff --git a/version.h b/version.h index 39a4a87af0..db19a459e3 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-02-05" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20090205 -#define RUBY_PATCHLEVEL 320 +#define RUBY_PATCHLEVEL 321 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit v1.2.3