Index: branches/wmf/1.18wmf1/extensions/FeaturedFeeds/FeaturedFeeds.body.php |
— | — | @@ -250,6 +250,7 @@ |
251 | 251 | private $items = false; |
252 | 252 | private $page = false; |
253 | 253 | private $entryName; |
| 254 | + private $titleForParse; |
254 | 255 | |
255 | 256 | public $title = false; |
256 | 257 | public $shortTitle; |
— | — | @@ -257,11 +258,8 @@ |
258 | 259 | |
259 | 260 | public function __construct( $name, $options, $lang ) { |
260 | 261 | global $wgContLang; |
261 | | - if ( !self::$parserOptions ) { |
262 | | - self::$parserOptions = new ParserOptions(); |
263 | | - self::$parserOptions->setEditSection( false ); |
264 | | - self::$parser = new Parser(); |
265 | | - } |
| 262 | + |
| 263 | + self::staticInit(); |
266 | 264 | $this->name = $name; |
267 | 265 | $this->options = $options; |
268 | 266 | if ( $options['inUserLanguage'] ) { |
— | — | @@ -271,6 +269,18 @@ |
272 | 270 | } |
273 | 271 | } |
274 | 272 | |
| 273 | + private static function staticInit() { |
| 274 | + if ( !self::$parserOptions ) { |
| 275 | + self::$parserOptions = new ParserOptions(); |
| 276 | + self::$parserOptions->setEditSection( false ); |
| 277 | + self::$parser = new Parser(); |
| 278 | + } |
| 279 | + } |
| 280 | + |
| 281 | + public function __wakeup() { |
| 282 | + self::staticInit(); |
| 283 | + } |
| 284 | + |
275 | 285 | /** |
276 | 286 | * @param $key string |
277 | 287 | * @return Message |
— | — | @@ -364,8 +374,13 @@ |
365 | 375 | $this->name . '/' . wfTimestamp( TS_MW, $date ) . '/' . $this->language->getCode() |
366 | 376 | )->getFullURL(); |
367 | 377 | |
| 378 | + if ( !isset( $this->titleForParse ) ) { |
| 379 | + // parsing with such title makes stuff like {{CURRENTMONTH}} localised |
| 380 | + $this->titleForParse = Title::newFromText( 'MediaWiki:Dummy/' . $this->language->getCode() ); |
| 381 | + } |
| 382 | + |
368 | 383 | return new FeaturedFeedItem( |
369 | | - self::$parser->transformMsg( $this->entryName, self::$parserOptions ), |
| 384 | + self::$parser->transformMsg( $this->entryName, self::$parserOptions, $this->titleForParse ), |
370 | 385 | wfExpandUrl( $url ), |
371 | 386 | $text, |
372 | 387 | $date |
Property changes on: branches/wmf/1.18wmf1/extensions |
___________________________________________________________________ |
Modified: svn:mergeinfo |
373 | 388 | Merged /trunk/extensions:r111698,111780 |