X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=blobdiff_plain;f=maintenance%2FgenerateSitemap.php;h=4c3fe7ba2da97661ea3904954bf876c6d999bafa;hb=04ffdb9d0aa236837f468c9a2b792846ed3f7358;hp=05dd0d08ab6d5b793b8d9d7f251131a07e33e66f;hpb=dfec83932fd38a9086eb5a2e212889ad00f35b0e;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index 05dd0d08ab..4c3fe7ba2d 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -132,7 +132,7 @@ class GenerateSitemap extends Maintenance { /** * A resource pointing to a sitemap file * - * @var resource + * @var resource|false */ public $file; @@ -188,18 +188,20 @@ class GenerateSitemap extends Maintenance { $this->fatalError( "Can not create directory $fspath." ); } + $dbDomain = WikiMap::getCurrentWikiDbDomain()->getId(); $this->fspath = realpath( $fspath ) . DIRECTORY_SEPARATOR; $this->urlpath = $this->getOption( 'urlpath', "" ); if ( $this->urlpath !== "" && substr( $this->urlpath, -1 ) !== '/' ) { $this->urlpath .= '/'; } - $this->identifier = $this->getOption( 'identifier', wfWikiID() ); + $this->identifier = $this->getOption( 'identifier', $dbDomain ); $this->compress = $this->getOption( 'compress', 'yes' ) !== 'no'; $this->skipRedirects = $this->hasOption( 'skip-redirects' ); $this->dbr = $this->getDB( DB_REPLICA ); $this->generateNamespaces(); $this->timestamp = wfTimestamp( TS_ISO_8601, wfTimestampNow() ); - $this->findex = fopen( "{$this->fspath}sitemap-index-{$this->identifier}.xml", 'wb' ); + $encIdentifier = rawurlencode( $this->identifier ); + $this->findex = fopen( "{$this->fspath}sitemap-index-{$encIdentifier}.xml", 'wb' ); $this->main(); }