X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FFeed.php;h=8bfe1c7ef9c1082982aa2d1da0b09dec9955004d;hb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;hp=9be3f577cba3ae5f4f42ec091f0785cc3cae8749;hpb=1e209d1e74cf2c0f5f78a3ca8014fc0af9d7f0a5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Feed.php b/includes/Feed.php index 9be3f577cb..f76a634d3f 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -54,8 +54,6 @@ class FeedItem { public $rssIsPermalink = false; /** - * Constructor - * * @param string|Title $title Item's title * @param string $description * @param string $url URL uniquely designating the item. @@ -92,7 +90,7 @@ class FeedItem { */ public function getUniqueId() { if ( $this->uniqueId ) { - return $this->xmlEncode( $this->uniqueId ); + return $this->xmlEncode( wfExpandUrl( $this->uniqueId, PROTO_CURRENT ) ); } } @@ -141,7 +139,7 @@ class FeedItem { */ public function getLanguage() { global $wgLanguageCode; - return $wgLanguageCode; + return wfBCP47( $wgLanguageCode ); } /** @@ -236,7 +234,6 @@ abstract class ChannelFeed extends FeedItem { $wgOut->addVaryHeader( 'X-Forwarded-Proto' ); } $wgOut->sendCacheControl(); - } /** @@ -248,12 +245,12 @@ abstract class ChannelFeed extends FeedItem { 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' ); }