From: Philip Tzou Date: Mon, 2 Feb 2009 14:15:21 +0000 (+0000) Subject: (bug 3311) Automatic category redirects X-Git-Tag: 1.31.0-rc.0~43073 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=c3152e263618e585e7fc3b1d022017099ac1ac9e;p=lhc%2Fweb%2Fwiklou.git (bug 3311) Automatic category redirects --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 603373a73e..1df6f30241 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -78,6 +78,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN for a given title. * Styled #mw-data-after-content in cologneblue.css to match the rest of the font (bug 17110) * (bug 7556) Time zone names in signatures lack i18n +* (bug 3311) Automatic category redirects === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index d0abf2f735..d3468f3d96 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -471,6 +471,14 @@ class LinksUpdate { foreach ( $diffs as $name => $sortkey ) { $nt = Title::makeTitleSafe( NS_CATEGORY, $name ); $wgContLang->findVariantLink( $name, $nt, true ); + // for category redirection + if ( $nt->isRedirect() ) { + $at = new Article( $nt ); + $nt = $at->getRedirectTarget(); + // we only redirect a category to another category + if ( $nt->getNamespace() == NS_CATEGORY ) + $name = $nt->getText(); + } $arr[] = array( 'cl_from' => $this->mId, 'cl_to' => $name,