| Index: trunk/phase3/includes/Skin.php |
| — | — | @@ -2124,6 +2124,8 @@ |
| 2125 | 2125 | */ |
| 2126 | 2126 | function addToSidebar( &$bar, $text ) { |
| 2127 | 2127 | $lines = explode( "\n", $text ); |
| | 2128 | + $wikiBar = array(); # We need to handle the wikitext on a different variable, to avoid trying to do an array operation on text, which would be a fatal error. |
| | 2129 | + |
| 2128 | 2130 | $heading = ''; |
| 2129 | 2131 | foreach( $lines as $line ) { |
| 2130 | 2132 | if( strpos( $line, '*' ) !== 0 ) { |
| — | — | @@ -2135,11 +2137,12 @@ |
| 2136 | 2138 | $bar[$heading] = array(); |
| 2137 | 2139 | } |
| 2138 | 2140 | } else { |
| | 2141 | + $line = trim( $line, '* ' ); |
| 2139 | 2142 | if( strpos( $line, '|' ) !== false ) { // sanity check |
| 2140 | 2143 | global $wgMessageCache; |
| 2141 | 2144 | $line = $wgMessageCache->transform( $line ); |
| 2142 | 2145 | |
| 2143 | | - $line = array_map( 'trim', explode( '|', trim( $line, '* ' ), 2 ) ); |
| | 2146 | + $line = array_map( 'trim', explode( '|', explode( '|', $line, 2 ), 2 ) ); |
| 2144 | 2147 | $link = wfMsgForContent( $line[0] ); |
| 2145 | 2148 | if( $link == '-' ) { |
| 2146 | 2149 | continue; |
| — | — | @@ -2171,11 +2174,26 @@ |
| 2172 | 2175 | 'id' => 'n-' . strtr( $line[1], ' ', '-' ), |
| 2173 | 2176 | 'active' => false |
| 2174 | 2177 | ); |
| | 2178 | + } else if ( (substr($line, 0, 2) == '{{') && (substr($line, -2) == '}}') ) { |
| | 2179 | + global $wgParser, $wgTitle; |
| | 2180 | + |
| | 2181 | + $line = substr($line, 2, strlen($line) - 4 ); |
| | 2182 | + |
| | 2183 | + if (is_null($wgParser->mOptions)) |
| | 2184 | + $wgParser->mOptions = new ParserOptions(); |
| | 2185 | + |
| | 2186 | + $wgParser->mOptions->setEditSection(false); |
| | 2187 | + $wikiBar[$heading] = $wgParser->parse( wfMsgForContentNoTrans( $line ) , $wgTitle, $wgParser->mOptions )->getText(); |
| 2175 | 2188 | } else { |
| 2176 | 2189 | continue; |
| 2177 | 2190 | } |
| 2178 | 2191 | } |
| 2179 | 2192 | } |
| | 2193 | + |
| | 2194 | + if ( count($wikiBar) > 0 ) |
| | 2195 | + $bar = array_merge($bar, $wikiBar); |
| | 2196 | + |
| | 2197 | + return $bar; |
| 2180 | 2198 | } |
| 2181 | 2199 | |
| 2182 | 2200 | /** |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -75,7 +75,8 @@ |
| 76 | 76 | * (bug 22844) Added support for WinCache object caching |
| 77 | 77 | * (bug 23580) Add two new events to LivePreview so that scripts can be |
| 78 | 78 | notified about the beginning and finishing of LivePreview actions |
| 79 | | - |
| | 79 | +* (bug 21278) Now the sidebar allows inclusion of wiki markup. |
| | 80 | + |
| 80 | 81 | === Bug fixes in 1.17 === |
| 81 | 82 | * (bug 17560) Half-broken deletion moved image files to deletion archive |
| 82 | 83 | without updating database |