*/
public function getUniqueId() {
if ( $this->uniqueId ) {
- return $this->xmlEncode( $this->uniqueId );
+ return $this->xmlEncode( wfExpandUrl( $this->uniqueId, PROTO_CURRENT ) );
}
}
*/
public function getLanguage() {
global $wgLanguageCode;
- return $wgLanguageCode;
+ return wfBCP47( $wgLanguageCode );
}
/**
}
/**
- * @todo document (needs one-sentence top-level class description).
+ * Class to support the outputting of syndication feeds in Atom and RSS format.
+ *
* @ingroup Feed
*/
abstract class ChannelFeed extends FeedItem {
$wgOut->addVaryHeader( 'X-Forwarded-Proto' );
}
$wgOut->sendCacheControl();
-
}
/**
global $wgRequest;
$ctype = $wgRequest->getVal( 'ctype', 'application/xml' );
- $allowedctypes = array(
+ $allowedctypes = [
'application/xml',
'text/xml',
'application/rss+xml',
'application/atom+xml'
- );
+ ];
return ( in_array( $ctype, $allowedctypes ) ? $ctype : 'application/xml' );
}
*/
class AtomFeed extends ChannelFeed {
/**
- * @todo document
- * @param string|int $ts
+ * Format a date given timestamp.
+ *
+ * @param string|int $timestamp
* @return string
*/
- function formatTime( $ts ) {
+ function formatTime( $timestamp ) {
// need to use RFC 822 time format at least for rss2.0
- return gmdate( 'Y-m-d\TH:i:s', wfTimestamp( TS_UNIX, $ts ) );
+ return gmdate( 'Y-m-d\TH:i:s', wfTimestamp( TS_UNIX, $timestamp ) );
}
/**