From: Ian Marlier Date: Wed, 29 Aug 2018 18:02:23 +0000 (-0400) Subject: sitemaps: absolute URL for sitemaps X-Git-Tag: 1.34.0-rc.0~4259^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=28fc31ccc3b6f7d3d02268a95fdca9a5c2b7c3ab;p=lhc%2Fweb%2Fwiklou.git sitemaps: absolute URL for sitemaps Google, at least, considers sitemap indexes that provide relative URLs as being broken. Bug: T202321 Change-Id: I5509be4b165eea9eca36e3f4975f87285ef87911 --- diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index 70fdebf403..dc1de4f480 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -485,7 +485,9 @@ class GenerateSitemap extends Maintenance { */ function indexEntry( $filename ) { return "\t\n" . - "\t\t{$this->urlpath}$filename\n" . + "\t\t" . wfGetServerUrl( PROTO_CANONICAL ) . + ( substr( $this->urlpath, 0, 1 ) === "/" ? "" : "/" ) . + "{$this->urlpath}$filename\n" . "\t\t{$this->timestamp}\n" . "\t\n"; }