aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Feed.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@users.mediawiki.org>2004-04-28 06:14:49 +0000
committerBrion Vibber <brion@users.mediawiki.org>2004-04-28 06:14:49 +0000
commit0ffaed11ffdff03ef64f96f701974f61ceb46f19 (patch)
tree9e49f91efcc6340584cd572d88bd45eaf09263bb /includes/Feed.php
parent4a7467853cfff3e4620ef73bf0664f38dad95e00 (diff)
downloadmediawikicore-0ffaed11ffdff03ef64f96f701974f61ceb46f19.tar.gz
mediawikicore-0ffaed11ffdff03ef64f96f701974f61ceb46f19.zip
Add atom feed <link> when syndication is on.
Fix language marker on Atom feed head element. Comment out empty dead fields in <author> in atom output.
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/3384
Diffstat (limited to 'includes/Feed.php')
-rw-r--r--includes/Feed.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/Feed.php b/includes/Feed.php
index 9a7198adade4..95f8e8c4ab52 100644
--- a/includes/Feed.php
+++ b/includes/Feed.php
@@ -147,7 +147,7 @@ class AtomFeed extends ChannelFeed {
$wgOut->sendCacheControl();
print '<' . '?xml version="1.0" encoding="utf-8"?' . ">\n";
- ?><feed version="0.3" xml:lang="<?php print $this->getLanguage()."-".$this->getLanguage() ?>">
+ ?><feed version="0.3" xml:lang="<?php print $this->getLanguage() ?>">
<title><?php print $this->getTitle() ?></title>
<link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/>
<modified><?php print $this->formatTime( wfTimestampNow() ) ?>Z</modified>
@@ -158,17 +158,18 @@ class AtomFeed extends ChannelFeed {
}
function outItem( $item ) {
+ global $wgMimeType;
?>
<entry>
<title><?php print $item->getTitle() ?></title>
- <link rel="alternate" type="text/html" href="<?php print $item->getUrl() ?>"/>
+ <link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print $item->getUrl() ?>"/>
<?php if( $item->getDate() ) { ?>
<modified><?php print $this->formatTime( $item->getDate() ) ?>Z</modified>
<issued><?php print $this->formatTime( $item->getDate() ) ?></issued>
<created><?php print $this->formatTime( $item->getDate() ) ?>Z</created><?php } ?>
<summary type="text/plain"><?php print $item->getDescription() ?></summary>
- <?php if( $item->getAuthor() ) { ?><author><name><?php print $item->getAuthor() ?></name><url></url><email></email></author><?php }?>
+ <?php if( $item->getAuthor() ) { ?><author><name><?php print $item->getAuthor() ?></name><!-- <url></url><email></email> --></author><?php }?>
<comment>foobar</comment>
</entry>