from other pages in their group.
* (bug 14263) Show a diff of the revert on rollback notification page.
* (bug 13434) Show a warning when hash identical files exist
+* Sidebar is now cached for all languages
=== Bug fixes in 1.13 ===
* Build an array that represents the sidebar(s), the navigation bar among them
*
* @return array
- * @private
*/
function buildSidebar() {
global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
- global $wgLang, $wgContLang;
-
- $fname = 'SkinTemplate::buildSidebar';
-
- wfProfileIn( $fname );
+ global $wgLang;
+ wfProfileIn( __METHOD__ );
- $key = wfMemcKey( 'sidebar' );
- $cacheSidebar = $wgEnableSidebarCache &&
- ($wgLang->getCode() == $wgContLang->getCode());
+ $key = wfMemcKey( 'sidebar', $wgLang->getCode() );
- if ($cacheSidebar) {
+ if ( $wgEnableSidebarCache ) {
$cachedsidebar = $parserMemc->get( $key );
- if ($cachedsidebar!="") {
- wfProfileOut($fname);
+ if ( $cachedsidebar ) {
+ wfProfileOut( __METHOD__ );
return $cachedsidebar;
}
}
$heading = $line;
} else {
if (strpos($line, '|') !== false) { // sanity check
- $line = explode( '|' , trim($line, '* '), 2 );
+ $line = array_map('trim', explode( '|' , trim($line, '* '), 2 ) );
$link = wfMsgForContent( $line[0] );
if ($link == '-')
continue;
} else { continue; }
}
}
- if ($cacheSidebar)
- $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
- wfProfileOut( $fname );
+ if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
+ wfProfileOut( __METHOD__ );
return $bar;
}
}