summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-09 12:30:31 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-09 12:30:31 +0000
commitf2bd994409bb6a8fb96eeadcbc12cbc3e30fb80e (patch)
tree9db026b9a0a70442e469348d1f8d38ee1a8468fa
parentb3b3223e586c91bf806a4092b22f07cf4b0a54bf (diff)
* lib/rexml/text.rb (REXML::Text#initialize): REXML::Text.new checks
raw text for illegal characters without entity check, for the sake of 1.8 compatibility. This had caused rubyspec error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/rexml/text.rb4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 95857fac44e..8c5c37ac212 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Feb 9 21:27:38 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * lib/rexml/text.rb (REXML::Text#initialize): REXML::Text.new checks
+ raw text for illegal characters without entity check, for the sake
+ of 1.8 compatibility. This had caused rubyspec error.
+
Mon Feb 8 23:49:24 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_getline_fast): wrong calculation of new position
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
index 5cef876c52a..0f15f00c31b 100644
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -117,7 +117,7 @@ module REXML
@string.gsub!( /\r\n?/, "\n" )
- Text.check(@string, illegal, doctype) if @raw and @parent
+ Text.check(@string, illegal, doctype) if @raw
end
def parent= parent
@@ -160,7 +160,7 @@ module REXML
else
raise "Illegal character '#{$1}' in raw string \"#{string}\""
end
- elsif $3 and !SUBSTITUTES.include?($1)
+ elsif @parent and $3 and !SUBSTITUTES.include?($1)
if !doctype or !doctype.entities.has_key?($3)
raise "Undeclared entity '#{$1}' in raw string \"#{string}\""
end