Index: trunk/extensions/Polyglot/Polyglot.php |
— | — | @@ -212,11 +212,23 @@ |
213 | 213 | $n = $title->getDBkey(); |
214 | 214 | $ns = $title->getNamespace(); |
215 | 215 | |
| 216 | + $titles = array(); |
| 217 | + $batch = new LinkBatch(); |
| 218 | + |
| 219 | + foreach ( $wgPolyglotLanguages as $lang ) { |
| 220 | + $obj = Title::makeTitle( $ns, $n . '/' . $lang ); |
| 221 | + $batch->addObj( $obj ); |
| 222 | + $titles[] = array( $obj, $lang ); |
| 223 | + } |
| 224 | + |
| 225 | + $batch->execute(); |
216 | 226 | $links = array(); |
217 | 227 | |
218 | | - foreach ($wgPolyglotLanguages as $lang) { |
219 | | - $t = Title::makeTitle($ns, $n . '/' . $lang); |
220 | | - if ($t->exists()) $links[$lang] = $t->getFullText(); |
| 228 | + foreach( $titles as $parts ) { |
| 229 | + list( $t, $lang ) = $parts; |
| 230 | + if ( $t->exists() ) { |
| 231 | + $links[$lang] = $t->getFullText(); |
| 232 | + } |
221 | 233 | } |
222 | 234 | |
223 | 235 | return $links; |