* LanguageConverter now support nested using of manual convert syntax like "-{-{}-}-"
* (bug 16281) Show copyright system message on special pages
* Upload license preview now uses the API instead of action=ajax
+* (bug 7346) Add <guid> to RSS to avoid duplicates
=== Bug fixes in 1.16 ===
var $Url = '';
var $Date = '';
var $Author = '';
+ var $UniqueId = '';
+ var $RSSIsPermalink;
/**#@-*/
/**
$this->Title = $Title;
$this->Description = $Description;
$this->Url = $Url;
+ $this->UniqueId = $Url;
+ $this->RSSIsPermalink = false;
$this->Date = $Date;
$this->Author = $Author;
$this->Comments = $Comments;
return htmlspecialchars( $string );
}
+ /**
+ * Get the unique id of this item
+ *
+ * @return String
+ */
+ public function getUniqueId() {
+ if ( $this->UniqueId ) {
+ return $this->xmlEncode( $this->UniqueId );
+ }
+ }
+
+ /**
+ * set the unique id of an item
+ *
+ * @param $uniqueId String: unique id for the item
+ * @param $RSSisPermalink Boolean: set to true if the guid (unique id) is a permalink (RSS feeds only)
+ */
+ public function setUniqueId($uniqueId, $RSSisPermalink = False) {
+ $this->UniqueId = $uniqueId;
+ $this->RSSIsPermalink = $isPermalink;
+ }
+
/**
* Get the title of this item; already xml-encoded
*
public function getComments() {
return $this->xmlEncode( $this->Comments );
}
-
+
/**
* Quickie hack... strip out wikilinks to more legible form from the comment.
*
<item>
<title><?php print $item->getTitle() ?></title>
<link><?php print $item->getUrl() ?></link>
+ <guid<?php if( $item->RSSIsPermalink ) print ' isPermaLink="true"' ?>><?php print $item->getUniqueId() ?></guid>
<description><?php print $item->getDescription() ?></description>
<?php if( $item->getDate() ) { ?><pubDate><?php print $this->formatTime( $item->getDate() ) ?></pubDate><?php } ?>
<?php if( $item->getAuthor() ) { ?><dc:creator><?php print $item->getAuthor() ?></dc:creator><?php }?>
global $wgMimeType;
?>
<entry>
- <id><?php print $item->getUrl() ?></id>
+ <id><?php print $item->getUniqueId() ?></id>
<title><?php print $item->getTitle() ?></title>
<link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print $item->getUrl() ?>"/>
<?php if( $item->getDate() ) { ?>