Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -428,25 +428,18 @@ |
429 | 429 | function getCategoryInsertions( $existing = array() ) { |
430 | 430 | global $wgContLang; |
431 | 431 | $diffs = array_diff_assoc( $this->mCategories, $existing ); |
432 | | - foreach ( $this->mCategories as $name => $sortkey ) { |
433 | | - $newname = $name; |
434 | | - $nt = Title::makeTitleSafe( NS_CATEGORY, $newname ); |
435 | | - $wgContLang->findVariantLink( $newname, $nt, true ); |
| 432 | + $arr = array(); |
| 433 | + foreach ( $diffs as $name => $sortkey ) { |
| 434 | + $nt = Title::makeTitleSafe( NS_CATEGORY, $name ); |
| 435 | + $wgContLang->findVariantLink( $name, $nt, true ); |
436 | 436 | // for category redirection |
437 | 437 | if ( $nt->isRedirect() ) { |
438 | 438 | $at = new Article( $nt ); |
439 | 439 | $nt = $at->getRedirectTarget(); |
440 | | - $newname = $nt->getText(); |
441 | 440 | // we only redirect a category to another category |
442 | | - if ( ! array_key_exists( $newname, $existing ) |
443 | | - and $nt->getNamespace() == NS_CATEGORY ) |
444 | | - $diffs[$newname] = $sortkey; |
| 441 | + if ( $nt->getNamespace() == NS_CATEGORY ) |
| 442 | + $name = $nt->getText(); |
445 | 443 | } |
446 | | - } |
447 | | - $arr = array(); |
448 | | - foreach ( $diffs as $name => $sortkey ) { |
449 | | - $nt = Title::makeTitleSafe( NS_CATEGORY, $name ); |
450 | | - $wgContLang->findVariantLink( $name, $nt, true ); |
451 | 444 | $arr[] = array( |
452 | 445 | 'cl_from' => $this->mId, |
453 | 446 | 'cl_to' => $name, |