From e6efe5b505f753fb65bd56cd0385c3ec9cc14520 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 20 May 2009 23:53:51 +0000 Subject: * lib/rexml/text.rb (REXML::Text.normalize): call to_s for input. [ruby-talk:337069] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/rexml/text.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b5bd805cee..1edb627249 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu May 21 08:50:58 2009 Yukihiro Matsumoto + + * lib/rexml/text.rb (REXML::Text.normalize): call to_s for input. + [ruby-talk:337069] + Mon May 18 21:40:11 2009 Tanaka Akira * lib/pathname.rb (Pathname#sub): suppress a warning. diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb index 2bc00429b3..a4a30b6d54 100644 --- a/lib/rexml/text.rb +++ b/lib/rexml/text.rb @@ -286,7 +286,7 @@ module REXML EREFERENCE = /&(?!#{Entity::NAME};)/ # Escapes all possible entities def Text::normalize( input, doctype=nil, entity_filter=nil ) - copy = input + copy = input.to_s # Doing it like this rather than in a loop improves the speed #copy = copy.gsub( EREFERENCE, '&' ) copy = copy.gsub( "&", "&" ) -- cgit v1.2.3