(bug 15543) fix for r38139: don't include $wgUser->mTouched and smaxage=0 in query...
[lhc/web/wiklou.git] / includes / Feed.php
index 6967426..21e8f08 100644 (file)
@@ -1,6 +1,5 @@
 <?php
-# Basic support for outputting syndication feeds in RSS, other formats
-#
+
 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>
 # http://www.mediawiki.org/
 #
 # http://www.gnu.org/copyleft/gpl.html
 
 /**
+ * Basic support for outputting syndication feeds in RSS, other formats.
  * Contain a feed class as well as classes to build rss / atom ... feeds
  * Available feeds are defined in Defines.php
  */
 
-
 /**
- * @todo document
+ * A base class for basic support for outputting syndication feeds in RSS and other formats.
  */
 class FeedItem {
        /**#@+
@@ -42,6 +41,7 @@ class FeedItem {
 
        /**#@+
         * @todo document
+        * @param $Url URL uniquely designating the item.
         */
        function __construct( $Title, $Description, $Url, $Date = '', $Author = '', $Comments = '' ) {
                $this->Title = $Title;
@@ -52,9 +52,6 @@ class FeedItem {
                $this->Comments = $Comments;
        }
 
-       /**
-        * @static
-        */
        function xmlEncode( $string ) {
                $string = str_replace( "\r\n", "\n", $string );
                $string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', '', $string );
@@ -75,7 +72,7 @@ class FeedItem {
 }
 
 /**
- * @todo document
+ * @todo document (needs one-sentence top-level class description).
  */
 class ChannelFeed extends FeedItem {
        /**#@+
@@ -146,18 +143,18 @@ class ChannelFeed extends FeedItem {
         * @private
         */
        function outXmlHeader() {
-               global $wgServer, $wgStylePath, $wgStyleVersion;
+               global $wgStylePath, $wgStyleVersion;
 
                $this->httpHeaders();
                echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
                echo '<?xml-stylesheet type="text/css" href="' .
-                       htmlspecialchars( "$wgServer$wgStylePath/common/feed.css?$wgStyleVersion" ) . '"?' . ">\n";
+                       htmlspecialchars( wfExpandUrl( "$wgStylePath/common/feed.css?$wgStyleVersion" ) ) .
+                       '"?' . ">\n";
        }
 }
 
 /**
  * Generate a RSS feed
- * @todo document
  */
 class RSSFeed extends ChannelFeed {
 
@@ -217,7 +214,6 @@ class RSSFeed extends ChannelFeed {
 
 /**
  * Generate an Atom feed
- * @todo document
  */
 class AtomFeed extends ChannelFeed {
        /**
@@ -301,5 +297,3 @@ class AtomFeed extends ChannelFeed {
        </feed><?php
        }
 }
-
-?>