Index: trunk/phase3/includes/Skin.php |
— | — | @@ -1650,24 +1650,18 @@ |
1651 | 1651 | * Build an array that represents the sidebar(s), the navigation bar among them |
1652 | 1652 | * |
1653 | 1653 | * @return array |
1654 | | - * @private |
1655 | 1654 | */ |
1656 | 1655 | function buildSidebar() { |
1657 | 1656 | global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry; |
1658 | | - global $wgLang, $wgContLang; |
| 1657 | + global $wgLang; |
| 1658 | + wfProfileIn( __METHOD__ ); |
1659 | 1659 | |
1660 | | - $fname = 'SkinTemplate::buildSidebar'; |
| 1660 | + $key = wfMemcKey( 'sidebar', $wgLang->getCode() ); |
1661 | 1661 | |
1662 | | - wfProfileIn( $fname ); |
1663 | | - |
1664 | | - $key = wfMemcKey( 'sidebar' ); |
1665 | | - $cacheSidebar = $wgEnableSidebarCache && |
1666 | | - ($wgLang->getCode() == $wgContLang->getCode()); |
1667 | | - |
1668 | | - if ($cacheSidebar) { |
| 1662 | + if ( $wgEnableSidebarCache ) { |
1669 | 1663 | $cachedsidebar = $parserMemc->get( $key ); |
1670 | | - if ($cachedsidebar!="") { |
1671 | | - wfProfileOut($fname); |
| 1664 | + if ( $cachedsidebar ) { |
| 1665 | + wfProfileOut( __METHOD__ ); |
1672 | 1666 | return $cachedsidebar; |
1673 | 1667 | } |
1674 | 1668 | } |
— | — | @@ -1683,7 +1677,7 @@ |
1684 | 1678 | $heading = $line; |
1685 | 1679 | } else { |
1686 | 1680 | if (strpos($line, '|') !== false) { // sanity check |
1687 | | - $line = explode( '|' , trim($line, '* '), 2 ); |
| 1681 | + $line = array_map('trim', explode( '|' , trim($line, '* '), 2 ) ); |
1688 | 1682 | $link = wfMsgForContent( $line[0] ); |
1689 | 1683 | if ($link == '-') |
1690 | 1684 | continue; |
— | — | @@ -1713,9 +1707,8 @@ |
1714 | 1708 | } else { continue; } |
1715 | 1709 | } |
1716 | 1710 | } |
1717 | | - if ($cacheSidebar) |
1718 | | - $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry ); |
1719 | | - wfProfileOut( $fname ); |
| 1711 | + if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry ); |
| 1712 | + wfProfileOut( __METHOD__ ); |
1720 | 1713 | return $bar; |
1721 | 1714 | } |
1722 | 1715 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -132,6 +132,7 @@ |
133 | 133 | from other pages in their group. |
134 | 134 | * (bug 14263) Show a diff of the revert on rollback notification page. |
135 | 135 | * (bug 13434) Show a warning when hash identical files exist |
| 136 | +* Sidebar is now cached for all languages |
136 | 137 | |
137 | 138 | === Bug fixes in 1.13 === |
138 | 139 | |