r81845 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81844‎ | r81845 | r81846 >
Date:21:01, 9 February 2011
Author:demon
Status:ok
Tags:
Comment:
Fix r81643. Constructing an object is code, not setup. It makes the extension explode when LocalSettings is included from a weird scope (eg: new installer)
Modified paths:
  • /trunk/extensions/DoubleWiki/DoubleWiki.php (modified) (history)
  • /trunk/extensions/DoubleWiki/DoubleWiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php
@@ -42,6 +42,11 @@
4343 }
4444 }
4545
 46+ static function OutputPageBeforeHTML( &$parserOutput , &$text ) {
 47+ $dw = new self();
 48+ $dw->addMatchedText( $parserOutput, $text );
 49+ }
 50+
4651 /*
4752 * Hook function called with &match=lang
4853 * Transform $text into a bilingual version
Index: trunk/extensions/DoubleWiki/DoubleWiki.php
@@ -24,7 +24,7 @@
2525
2626 $wgExtensionMessagesFiles['DoubleWiki'] = dirname(__FILE__) . '/DoubleWiki.i18n.php';
2727 $wgAutoloadClasses['DoubleWiki'] = dirname( __FILE__ ) . "/DoubleWiki_body.php";
28 -$wgHooks['OutputPageBeforeHTML'][] = array( new DoubleWiki, 'addMatchedText' );
 28+$wgHooks['OutputPageBeforeHTML'][] = array( 'DoubleWiki', 'OutputPageBeforeHTML' );
2929
3030 $wgExtensionCredits['other'][] = array(
3131 'path' => __FILE__,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81643Fix weird hook registration from r71624demon19:43, 7 February 2011

Status & tagging log