Merge "Rename autonym for 'no' from 'norsk bokmål' to 'norsk'"
[lhc/web/wiklou.git] / includes / Feed.php
index 600b136..f76a634 100644 (file)
@@ -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.
@@ -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' );
        }