aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rss/utils.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-22 16:03:57 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-22 16:03:57 +0000
commit5e648821233fa9aedeeb50e7c6c048550860298d (patch)
tree02fa443fef401cd141410133be83e22be20547bc /lib/rss/utils.rb
parent588ac3ee1fd23690e2da36986f736aac12bec589 (diff)
downloadruby-5e648821233fa9aedeeb50e7c6c048550860298d.tar.gz
rss itunes: fix a bug that <itunes:explicit> value isn't fully supported
Fix GH-1725 <itunes:explicit> accepts "explicit", "yes", "true", "clean", "no" and "false" as valid values. Here is the <itunes:explicit>'s description in https://help.apple.com/itc/podcasts_connect/#/itcb54353390: > The <itunes:explicit> tag indicates whether your podcast contains > explicit material. You can specify the following values: > > * Yes | Explicit | True. If you specify yes, explicit, or true, > indicating the presence of explicit content, the iTunes Store > displays an Explicit parental advisory graphic for your podcast. > > * Clean | No | False. If you specify clean, no, or false, indicating > that none of your podcast episodes contain explicit language or > adult content, the iTunes Store displays a Clean parental > advisory graphic for your podcast. I don't know whether <itunes:explicit> value is case sensitive or insensitive. But the current implementation is case insensitive. Reported by Valerie Woolard Srinivasan. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/utils.rb')
-rw-r--r--lib/rss/utils.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rss/utils.rb b/lib/rss/utils.rb
index ce7dbf1b02..9203df9a9b 100644
--- a/lib/rss/utils.rb
+++ b/lib/rss/utils.rb
@@ -125,16 +125,16 @@ module RSS
[true, false].include?(args[0]) and args[1].is_a?(Hash)
end
- module YesCleanOther
+ module ExplicitCleanOther
module_function
def parse(value)
if [true, false, nil].include?(value)
value
else
case value.to_s
- when /\Ayes\z/i
+ when /\Aexplicit|yes|true\z/i
true
- when /\Aclean\z/i
+ when /\Aclean|no|false\z/i
false
else
nil