diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/rss/rss.rb | 2 | ||||
-rw-r--r-- | test/rss/test_to_s.rb | 24 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 33 insertions, 2 deletions
@@ -1,3 +1,10 @@ +Fri Jun 30 21:46:50 2017 Kouhei Sutou <kou@cozmixng.org> + + * lib/rss/rss.rb: Accept empty text element as valid element + Parser has been accepted it but XML serializer wasn't accepted. + Reported by stefano frabetti. Thanks!!! + [Bug #13531] + Fri Jun 30 21:40:42 2017 Kazuki Yamaguchi <k@rhe.jp> * ext/openssl/ossl_x509store.c: clear error queue after calling diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index 1bb0f6e826..3921e48457 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -963,7 +963,7 @@ EOC children = child children.any? {|c| c.have_required_elements?} else - !child.to_s.empty? + not child.nil? end else true diff --git a/test/rss/test_to_s.rb b/test/rss/test_to_s.rb index b8ef0d8da4..bbdd74ef0b 100644 --- a/test/rss/test_to_s.rb +++ b/test/rss/test_to_s.rb @@ -109,6 +109,30 @@ module RSS '[ruby-core:70667] [Bug #11509]') end + def test_20_empty_text + title = "Blog entries" + link = "http://blog.example.com/" + description = "" + rss = RSS::Maker.make("2.0") do |maker| + maker.channel.title = title + maker.channel.link = link + maker.channel.description = description + end + + parsed_rss = RSS::Parser.parse(rss.to_s) + assert_equal({ + title: title, + link: link, + description: description, + }, + { + title: parsed_rss.channel.title, + link: parsed_rss.channel.link, + description: parsed_rss.channel.description, + }, + "[ruby-core:80965] [Bug #13531]") + end + private def setup_xml_declaration_info @version = "1.0" @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.5" #define RUBY_RELEASE_DATE "2017-06-30" -#define RUBY_PATCHLEVEL 332 +#define RUBY_PATCHLEVEL 333 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 6 |