From f2bd994409bb6a8fb96eeadcbc12cbc3e30fb80e Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 9 Feb 2010 12:30:31 +0000 Subject: * 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 --- lib/rexml/text.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rexml') diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb index 5cef876c52..0f15f00c31 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 -- cgit v1.2.3