X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FFeed.php;h=1674b1317428021b982f8ce04b9848e2e8548773;hb=f8de918277e34656de5dc4f78a2a0d90b63ffec1;hp=7089c925bdd154216607a1acbb37c1d0b6046ba5;hpb=866f478dc93eb70d2b381ecf3a9614ae66105a97;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Feed.php b/includes/Feed.php index 7089c925bd..1674b13174 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -36,18 +36,22 @@ * @ingroup Feed */ class FeedItem { - /** - * @var Title - */ - var $title; + /** @var Title */ + protected $title; + + protected $description; + + protected $url; + + protected $date; - var $description; - var $url; - var $date; - var $author; - var $uniqueId; - var $comments; - var $rssIsPermalink = false; + protected $author; + + protected $uniqueId; + + protected $comments; + + public $rssIsPermalink = false; /** * Constructor @@ -238,27 +242,35 @@ abstract class ChannelFeed extends FeedItem { * Return an internet media type to be sent in the headers. * * @return string - * @private */ - function contentType() { + private function contentType() { global $wgRequest; + $ctype = $wgRequest->getVal( 'ctype', 'application/xml' ); - $allowedctypes = array( 'application/xml', 'text/xml', 'application/rss+xml', 'application/atom+xml' ); + $allowedctypes = array( + 'application/xml', + 'text/xml', + 'application/rss+xml', + 'application/atom+xml' + ); + return ( in_array( $ctype, $allowedctypes ) ? $ctype : 'application/xml' ); } /** * Output the initial XML headers with a stylesheet for legibility * if someone finds it in a browser. - * @private */ - function outXmlHeader() { + protected function outXmlHeader() { global $wgStylePath, $wgStyleVersion; $this->httpHeaders(); echo '' . "\n"; echo '\n"; } } @@ -303,6 +315,7 @@ class RSSFeed extends ChannelFeed { * @param FeedItem $item Item to be output */ function outItem( $item ) { + // @codingStandardsIgnoreStart Ignore long lines and formatting issues. ?> <?php print $item->getTitle(); ?> @@ -314,6 +327,7 @@ class RSSFeed extends ChannelFeed { getComments() ) { ?>getComments(), PROTO_CURRENT ); ?> outXmlHeader(); + // @codingStandardsIgnoreStart Ignore long lines and formatting issues. ?> getFeedId() ?> <?php print $this->getTitle() ?> @@ -358,6 +373,7 @@ class AtomFeed extends ChannelFeed { MediaWiki getSelfUrl(); } /** * Atom 1.0 requests a self-reference to the feed. * @return string - * @private */ - function getSelfUrl() { + private function getSelfUrl() { global $wgRequest; return htmlspecialchars( $wgRequest->getFullRequestURL() ); } @@ -389,6 +403,7 @@ class AtomFeed extends ChannelFeed { */ function outItem( $item ) { global $wgMimeType; + // @codingStandardsIgnoreStart Ignore long lines and formatting issues. ?> getUniqueId(); ?> @@ -412,5 +427,6 @@ class AtomFeed extends ChannelFeed { */ function outFooter() {?>