From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/Feed.php | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'includes/Feed.php') diff --git a/includes/Feed.php b/includes/Feed.php index bc20a9dc..ef33c78f 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -36,9 +36,8 @@ * @ingroup Feed */ class FeedItem { - /**#@+ - * @var string - * @private + /** + * @var Title */ var $Title = 'Wiki'; var $Description = ''; @@ -47,12 +46,11 @@ class FeedItem { var $Author = ''; var $UniqueId = ''; var $RSSIsPermalink; - /**#@-*/ /** * Constructor * - * @param $Title String: Item's title + * @param $Title String|Title Item's title * @param $Description String * @param $Url String: URL uniquely designating the item. * @param $Date String: Item's date @@ -70,6 +68,15 @@ class FeedItem { $this->Comments = $Comments; } + /** + * Get the last touched timestamp + * + * @return String last-touched timestamp + */ + public function getLastMod() { + return $this->Title->getTouched(); + } + /** * Encode $string so that it can be safely embedded in a XML document * @@ -99,7 +106,7 @@ class FeedItem { * @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) { + public function setUniqueId($uniqueId, $RSSisPermalink = false) { $this->UniqueId = $uniqueId; $this->RSSIsPermalink = $RSSisPermalink; } @@ -113,6 +120,16 @@ class FeedItem { return $this->xmlEncode( $this->Title ); } + /** + * Get the DB prefixed title + * + * @return String the prefixed title, with underscores and + * any interwiki and namespace prefixes + */ + public function getDBPrefixedTitle() { + return $this->Title->getPrefixedDBKey(); + } + /** * Get the URL of this item; already xml-encoded * @@ -222,12 +239,15 @@ class ChannelFeed extends FeedItem { * but can also be called separately. */ public function httpHeaders() { - global $wgOut; + global $wgOut, $wgVaryOnXFP; # We take over from $wgOut, excepting its cache header info $wgOut->disable(); $mimetype = $this->contentType(); header( "Content-type: $mimetype; charset=UTF-8" ); + if ( $wgVaryOnXFP ) { + $wgOut->addVaryHeader( 'X-Forwarded-Proto' ); + } $wgOut->sendCacheControl(); } @@ -256,7 +276,7 @@ class ChannelFeed extends FeedItem { $this->httpHeaders(); echo '' . "\n"; echo '\n"; } } @@ -288,7 +308,7 @@ class RSSFeed extends ChannelFeed { ?> <?php print $this->getTitle() ?> - getUrl() ?> + getUrl(), PROTO_CURRENT ) ?> getDescription() ?> getLanguage() ?> MediaWiki @@ -304,12 +324,12 @@ class RSSFeed extends ChannelFeed { ?> <?php print $item->getTitle() ?> - getUrl() ?> + getUrl(), PROTO_CURRENT ) ?> RSSIsPermalink ) print ' isPermaLink="false"' ?>>getUniqueId() ?> getDescription() ?> getDate() ) { ?>formatTime( $item->getDate() ) ?> getAuthor() ) { ?>getAuthor() ?> - getComments() ) { ?>getComments() ?> + getComments() ) { ?>getComments(), PROTO_CURRENT ) ?> getFeedId() ?> <?php print $this->getTitle() ?> - - + + formatTime( wfTimestampNow() ) ?>Z getDescription() ?> MediaWiki @@ -390,7 +410,7 @@ class AtomFeed extends ChannelFeed { getUniqueId() ?> <?php print $item->getTitle() ?> - + getDate() ) { ?> formatTime( $item->getDate() ) ?>Z @@ -399,9 +419,9 @@ class AtomFeed extends ChannelFeed { getAuthor() ) { ?>getAuthor() ?> -getComments() ) { ?>getComments() ?> - */ + */ } /** -- cgit v1.2.3-54-g00ecf