RSS: Add ability to specify isPermaLink="false" for GUID

This commit is contained in:
Justin Kromlinger 2020-11-20 00:19:15 +01:00 committed by Kevin Morris
parent 0c1241f8bb
commit 18ec8e3cc8

View file

@ -183,7 +183,7 @@ class FeedItem extends HtmlDescribable {
/** /**
* Optional attributes of an item. * Optional attributes of an item.
*/ */
var $author, $authorEmail, $image, $category, $comments, $guid, $source, $creator; var $author, $authorEmail, $image, $category, $comments, $guid, $guidIsPermaLink, $source, $creator;
/** /**
* Publishing date of an item. May be in one of the following formats: * Publishing date of an item. May be in one of the following formats:
@ -995,7 +995,11 @@ class RSSCreator091 extends FeedCreator {
$feed.= " <pubDate>".htmlspecialchars($itemDate->rfc822())."</pubDate>\n"; $feed.= " <pubDate>".htmlspecialchars($itemDate->rfc822())."</pubDate>\n";
} }
if ($this->items[$i]->guid!="") { if ($this->items[$i]->guid!="") {
$feed.= " <guid>".htmlspecialchars($this->items[$i]->guid)."</guid>\n"; $feed.= " <guid";
if ($this->items[$i]->guidIsPermaLink == false) {
$feed.= " isPermaLink=\"false\"";
}
$feed.= ">".htmlspecialchars($this->items[$i]->guid)."</guid>\n";
} }
$feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, " "); $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, " ");
$feed.= " </item>\n"; $feed.= " </item>\n";