X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderWikiModule.php;h=4fdd86eaca360f2ea16db3f58656d61a3e6a1893;hb=dbe592df6d1914eb5d9a57c66792cbf4d59e3be7;hp=5580306a134e12144c1f203880e685c8ef9c36ba;hpb=fc7d715b4b5adedd0ae3e9e6f969c89e19d460eb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index 5580306a13..4fdd86eaca 100644 --- a/includes/resourceloader/ResourceLoaderWikiModule.php +++ b/includes/resourceloader/ResourceLoaderWikiModule.php @@ -296,12 +296,12 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { sort( $pageNames ); $key = implode( '|', $pageNames ); if ( !isset( $this->titleInfo[$key] ) ) { - $this->titleInfo[$key] = self::fetchTitleInfo( $dbr, $pageNames, __METHOD__ ); + $this->titleInfo[$key] = static::fetchTitleInfo( $dbr, $pageNames, __METHOD__ ); } return $this->titleInfo[$key]; } - private static function fetchTitleInfo( IDatabase $db, array $pages, $fname = __METHOD__ ) { + protected static function fetchTitleInfo( IDatabase $db, array $pages, $fname = __METHOD__ ) { $titleInfo = []; $batch = new LinkBatch; foreach ( $pages as $titleText ) { @@ -353,10 +353,17 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { } } } - $allInfo = self::fetchTitleInfo( $db, array_keys( $allPages ), __METHOD__ ); + $allInfo = static::fetchTitleInfo( $db, array_keys( $allPages ), __METHOD__ ); foreach ( $wikiModules as $module ) { $pages = $module->getPages( $context ); - $info = array_intersect_key( $allInfo, $pages ); + // Before we intersect, map the names to canonical form (T145673). + $intersect = []; + foreach ( $pages as $page => $unused ) { + $title = Title::newFromText( $page )->getPrefixedText(); + $intersect[$title] = 1; + } + $info = array_intersect_key( $allInfo, $intersect ); + $pageNames = array_keys( $pages ); sort( $pageNames ); $key = implode( '|', $pageNames );