From 9464846192eddd9c7cdaea987e56d341e3c178fe Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Mon, 14 May 2007 03:23:02 +0000 Subject: [PATCH] wrap links to redirects in in categories, similar to what Special:Allpages does --- RELEASE-NOTES | 2 ++ includes/CategoryPage.php | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e80ca3707c..67d0beba14 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -26,6 +26,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 8868) Separate "blocked" message for autoblocks * Adding expiry of block to block messages * Bulk mail options ($wgEnotifImpersonal, $wgEnotifUseJobQ) for large sites +* Links to redirect pages in categories are wrapped in == Bugfixes since 1.10 == diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 356f9ea288..9b11d26409 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -147,7 +147,7 @@ class CategoryViewer { /** * Add a page in the image namespace */ - function addImage( $title, $sortkey, $pageLength ) { + function addImage( $title, $sortkey, $pageLength, $isRedirect = false ) { if ( $this->showGallery ) { $image = new Image( $title ); if( $this->flip ) { @@ -156,18 +156,21 @@ class CategoryViewer { $this->gallery->add( $image ); } } else { - $this->addPage( $title, $sortkey, $pageLength ); + $this->addPage( $title, $sortkey, $pageLength, $isRedirect ); } } /** * Add a miscellaneous page */ - function addPage( $title, $sortkey, $pageLength ) { + function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; - $this->articles[] = $this->getSkin()->makeSizeLinkObj( + $link = $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $wgContLang->convert( $title->getPrefixedText() ) ); + if ($isRedirect) + $link = ''.$link.''; + $this->articles[] = $link; $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) ); } @@ -194,7 +197,7 @@ class CategoryViewer { } $res = $dbr->select( array( 'page', 'categorylinks' ), - array( 'page_title', 'page_namespace', 'page_len', 'cl_sortkey' ), + array( 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey' ), array( $pageCondition, 'cl_from = page_id', 'cl_to' => $this->title->getDBKey()), @@ -220,9 +223,9 @@ class CategoryViewer { if( $title->getNamespace() == NS_CATEGORY ) { $this->addSubcategory( $title, $x->cl_sortkey, $x->page_len ); } elseif( $title->getNamespace() == NS_IMAGE ) { - $this->addImage( $title, $x->cl_sortkey, $x->page_len ); + $this->addImage( $title, $x->cl_sortkey, $x->page_len, !!$x->page_is_redirect ); } else { - $this->addPage( $title, $x->cl_sortkey, $x->page_len ); + $this->addPage( $title, $x->cl_sortkey, $x->page_len, !!$x->page_is_redirect ); } } $dbr->freeResult( $res ); -- 2.20.1