From: Brion Vibber Date: Mon, 12 Sep 2011 19:09:51 +0000 (+0000) Subject: * (bug 30865) Fix regression breaking category pages when there's no local page content X-Git-Tag: 1.31.0-rc.0~27711 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=79ebdd4640365069f444259730a6d92553ebf98e;p=lhc%2Fweb%2Fwiklou.git * (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. --- 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; }