Merge "resourceloader: Make MessageBlobStore global check key actually global"
[lhc/web/wiklou.git] / maintenance / generateSitemap.php
index 70fdebf..7d43f21 100644 (file)
@@ -230,7 +230,7 @@ class GenerateSitemap extends Maintenance {
                // Custom priorities
                if ( $wgSitemapNamespacesPriorities !== false ) {
                        /**
-                        * @var $wgSitemapNamespacesPriorities array
+                        * @var array $wgSitemapNamespacesPriorities
                         */
                        foreach ( $wgSitemapNamespacesPriorities as $namespace => $priority ) {
                                $float = floatval( $priority );
@@ -290,7 +290,7 @@ class GenerateSitemap extends Maintenance {
         * @return string
         */
        function guessPriority( $namespace ) {
-               return MWNamespace::isSubject( $namespace )
+               return MediaWikiServices::getInstance()->getNamespaceInfo()->isSubject( $namespace )
                        ? $this->priorities[self::GS_MAIN]
                        : $this->priorities[self::GS_TALK];
        }
@@ -485,7 +485,9 @@ class GenerateSitemap extends Maintenance {
         */
        function indexEntry( $filename ) {
                return "\t<sitemap>\n" .
-                       "\t\t<loc>{$this->urlpath}$filename</loc>\n" .
+                       "\t\t<loc>" . wfGetServerUrl( PROTO_CANONICAL ) .
+                               ( substr( $this->urlpath, 0, 1 ) === "/" ? "" : "/" ) .
+                               "{$this->urlpath}$filename</loc>\n" .
                        "\t\t<lastmod>{$this->timestamp}</lastmod>\n" .
                        "\t</sitemap>\n";
        }