From 79ebdd4640365069f444259730a6d92553ebf98e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 12 Sep 2011 19:09:51 +0000 Subject: [PATCH] * (bug 30865) Fix regression breaking category pages when there's no local page content Output in CategoryViewer::getHtml() was trying to close an outside div, then re-open another one (with different dir/lang settings). Switched it to instead open a child div with the desired properties, so there's no danger of surprise inconsistency. --- includes/CategoryPage.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index bb08cf518e..c833886a70 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -143,7 +143,7 @@ class CategoryViewer { * @return string HTML output */ public function getHTML() { - global $wgOut, $wgCategoryMagicGallery; + global $wgOut, $wgCategoryMagicGallery, $wgLang; wfProfileIn( __METHOD__ ); $this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery; @@ -172,14 +172,14 @@ class CategoryViewer { // Give a proper message if category is empty if ( $r == '' ) { $r = wfMsgExt( 'category-empty', array( 'parse' ) ); - } else { - $pageLang = $this->title->getPageLanguage(); - $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); - # close the previous div, show the headings in user language, - # then open a new div with the page content language again - $r = '' . $r . Html::openElement( 'div', $langAttribs ); } + $pageLang = $this->title->getPageLanguage(); + $langAttribs = array( 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ); + # close the previous div, show the headings in user language, + # then open a new div with the page content language again + $r = Html::openElement( 'div', $langAttribs ) . $r . ''; + wfProfileOut( __METHOD__ ); return $r; } -- 2.20.1