Skip to content

Commit

Permalink
Fix valid values for media:restriction relationship
Browse files Browse the repository at this point in the history
'deny' instead of 'disallow'
As reported in rubys/feedvalidator#43
Per spec at http://www.rssboard.org/media-rss#media-restriction
  • Loading branch information
dontcallmedom committed Feb 24, 2020
1 parent 9ce6086 commit ef07d7d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs-xml/error/InvalidMediaRestrictionRel.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<fvdoc>
<div xmlns='http://www.w3.org/1999/xhtml'>
<div id='message'>
<p><code>relationship</code> must be 'allow' or 'disallow'</p>
<p><code>relationship</code> must be 'allow' or 'deny'</p>
</div>
<div id='explanation'>
<p>The specified attribute value is not a valid media:restriction relationship value.</p>
</div>
<div id='solution'>
<p>Change the attribute value to either <code>allow</code> or <code>disallow</code>.</p>
<p>Change the attribute value to either <code>allow</code> or <code>deny</code>.</p>
</div>
</div>
</fvdoc>
6 changes: 3 additions & 3 deletions docs/error/InvalidMediaRestrictionRel.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>relationship must be 'allow' or 'disallow'</title>
<title>relationship must be 'allow' or 'deny'</title>
<style media="screen">@import "../../css/common.css";
@import "../../css/documentation.css";</style>
<script><!-- --></script>
Expand All @@ -18,7 +18,7 @@ <h1><a href="../../"><span id="feed"><span id="f">F</span><span id="e1">E</span>
<div id="main">
<h2>Message</h2>
<div class="docbody">
<p><code>relationship</code> must be 'allow' or 'disallow'</p>
<p><code>relationship</code> must be 'allow' or 'deny'</p>
</div>
<h2>Explanation</h2>

Expand All @@ -27,7 +27,7 @@ <h2>Explanation</h2>
</div>
<h2>Solution</h2>
<div class="docbody">
<p>Change the attribute value to either <code>allow</code> or <code>disallow</code>.</p>
<p>Change the attribute value to either <code>allow</code> or <code>deny</code>.</p>
</div>
<h2>Not clear? Disagree?</h2>
<div class="docbody">
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h3>Errors</h3>
<li><a href="error/InvalidMediaMedium.html">Invalid content medium: "<code>foo</code>"</a></li>
<li><a href="error/InvalidMediaRating.html">Invalid Media Rating</a></li>
<li><a href="error/InvalidMediaRestriction.html"><code>media:restriction</code> must be 'all' or 'none'</a></li>
<li><a href="error/InvalidMediaRestrictionRel.html"><code>relationship</code> must be 'allow' or 'disallow'</a></li>
<li><a href="error/InvalidMediaRestrictionRel.html"><code>relationship</code> must be 'allow' or 'deny'</a></li>
<li><a href="error/InvalidMediaRestrictionType.html"><code>type</code> must be 'country' or 'uri'</a></li>
<li><a href="error/InvalidMediaTextType.html">type attribute must be "plain" or "html"</a></li>
<li><a href="error/InvalidMetaContent.html">Invalid value for <code>content</code>: "<code>foo</code>"</a></li>
Expand Down
2 changes: 1 addition & 1 deletion src/feedvalidator/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def validate(self):
relationship = self.attrs.get((None, 'relationship'))
if not relationship:
self.log(MissingAttribute({"parent":self.parent.name, "element":self.name, "attr":"relationship"}))
elif relationship not in ['allow','disallow']:
elif relationship not in ['allow','deny']:
self.log(InvalidMediaRestrictionRel({"parent":self.parent.name, "element":self.name, "attr":"relationship", "value":relationship}))

type = self.attrs.get((None, 'type'))
Expand Down
4 changes: 2 additions & 2 deletions testcases/ext/media/valid_restriction_deny.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<!--
Description: valid media restriction - disallow
Description: valid media restriction - deny
Expect: !Error
-->

Expand All @@ -18,7 +18,7 @@
<link>http://www.foo.com/item1.htm</link>
<media:content url="http://www.foo.com/trailer.mov"
fileSize="12216320" type="video/quicktime" expression="sample"/>
<media:restriction relationship="disallow"/>
<media:restriction relationship="deny"/>
</item>
</channel>
</rss>

0 comments on commit ef07d7d

Please sign in to comment.