r111698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111697‎ | r111698 | r111699 >
Date:23:00, 16 February 2012
Author:maxsem
Status:ok
Tags:
Comment:
Bug 34448 - call to a member function setTimestamp() on a non-object
Modified paths:
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php
@@ -257,11 +257,8 @@
258258
259259 public function __construct( $name, $options, $lang ) {
260260 global $wgContLang;
261 - if ( !self::$parserOptions ) {
262 - self::$parserOptions = new ParserOptions();
263 - self::$parserOptions->setEditSection( false );
264 - self::$parser = new Parser();
265 - }
 261+
 262+ self::staticInit();
266263 $this->name = $name;
267264 $this->options = $options;
268265 if ( $options['inUserLanguage'] ) {
@@ -271,6 +268,18 @@
272269 }
273270 }
274271
 272+ private static function staticInit() {
 273+ if ( !self::$parserOptions ) {
 274+ self::$parserOptions = new ParserOptions();
 275+ self::$parserOptions->setEditSection( false );
 276+ self::$parser = new Parser();
 277+ }
 278+ }
 279+
 280+ public function __wakeup() {
 281+ self::staticInit();
 282+ }
 283+
275284 /**
276285 * @param $key string
277286 * @return Message

Follow-up revisions

RevisionCommit summaryAuthorDate
r112023MFT r111698, r111780, r111947reedy17:01, 21 February 2012
r112029MFT r111698, r111780 to attempt to shut up some of the warningsreedy17:34, 21 February 2012

Status & tagging log