[前][次][番号順一覧][スレッド一覧]

ruby-changes:8587

From: shugo <ko1@a...>
Date: Fri, 7 Nov 2008 02:09:47 +0900 (JST)
Subject: [ruby-changes:8587] Ruby:r20121 (ruby_1_8): * lib/rexml/entity.rb (unnormalized): do not call

shugo	2008-11-07 02:09:29 +0900 (Fri, 07 Nov 2008)

  New Revision: 20121

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20121

  Log:
    * 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.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/rexml/entity.rb
    branches/ruby_1_8/test/rexml/test_document.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 20120)
+++ ruby_1_8/ChangeLog	(revision 20121)
@@ -1,3 +1,12 @@
+Fri Nov  7 02:08:04 2008  Shugo Maeda  <shugo@r...>
+
+	* 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.
+
 Tue Nov  4 03:28:31 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* array.c (rb_ary_join): do not repeat self in a recursive array.
Index: ruby_1_8/lib/rexml/entity.rb
===================================================================
--- ruby_1_8/lib/rexml/entity.rb	(revision 20120)
+++ ruby_1_8/lib/rexml/entity.rb	(revision 20121)
@@ -73,7 +73,7 @@
 		# 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)
Index: ruby_1_8/test/rexml/test_document.rb
===================================================================
--- ruby_1_8/test/rexml/test_document.rb	(revision 20120)
+++ ruby_1_8/test/rexml/test_document.rb	(revision 20121)
@@ -35,6 +35,7 @@
 <member>
 &a;
 &a2;
+&lt;
 </member>
 EOF
 
@@ -53,7 +54,7 @@
 
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]