r81643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81642‎ | r81643 | r81644 >
Date:19:43, 7 February 2011
Author:demon
Status:resolved
Tags:
Comment:
Fix weird hook registration from r71624
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
@@ -24,14 +24,6 @@
2525 */
2626 var $tags = "/<\/?(b|del|i|ins|u|font|big|small|sub|sup|h1|h2|h3|h4|h5|h6|cite|code|em|s|strike|strong|tt|tr|td|var|div|center|blockquote|ol|ul|dl|table|caption|pre|ruby|rt|rb|rp|p|span)([\s](.*?)>|>)/i";
2727
28 - /**
29 - * Constructor
30 - */
31 - function __construct() {
32 - global $wgHooks;
33 - $wgHooks['OutputPageBeforeHTML'][] = array( &$this, 'addMatchedText' );
34 - }
35 -
3628 /*
3729 * Read the list of matched phrases and add tags to the html output.
3830 */
Index: trunk/extensions/DoubleWiki/DoubleWiki.php
@@ -22,9 +22,9 @@
2323 # that can be accessed through interlanguage links
2424
2525
26 -$wgHooks['ParserFirstCallInit'][] = 'wfDoubleWiki';
2726 $wgExtensionMessagesFiles['DoubleWiki'] = dirname(__FILE__) . '/DoubleWiki.i18n.php';
2827 $wgAutoloadClasses['DoubleWiki'] = dirname( __FILE__ ) . "/DoubleWiki_body.php";
 28+$wgHooks['OutputPageBeforeHTML'][] = array( new DoubleWiki, 'addMatchedText' );
2929
3030 $wgExtensionCredits['other'][] = array(
3131 'path' => __FILE__,
@@ -33,11 +33,3 @@
3434 'url' => 'http://wikisource.org/wiki/Wikisource:DoubleWiki_Extension',
3535 'descriptionmsg' => 'doublewiki-desc',
3636 );
37 -
38 -
39 -function wfDoubleWiki() {
40 - new DoubleWiki;
41 - return true;
42 -}
43 -
44 -

Follow-up revisions

RevisionCommit summaryAuthorDate
r81845Fix r81643. Constructing an object is code, not setup. It makes the extension...demon21:01, 9 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71624moving extension code into its own class; no functional change in this committhomasv08:09, 25 August 2010

Status & tagging log