r30083 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30082‎ | r30083 | r30084 >
Date:20:49, 23 January 2008
Author:yaron
Status:old
Tags:
Comment:
Added initialization of variable, creation of new wiki-text parser replaced
with call to global parser
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc
@@ -114,6 +114,7 @@
115115 // in the latter case, it may remain false until close to the end of
116116 // the parsing, so we have to assume that it will become a possibility
117117 $form_is_partial = false;
 118+ $new_text = "";
118119
119120 // if we have existing content and we're not in an active replacement
120121 // situation, preserve the original content. We do this because we want
@@ -174,10 +175,9 @@
175176 global $sfgDisableWikiTextParsing;
176177 if (! $sfgDisableWikiTextParsing) {
177178 $form_def = strtr($form_def, array('{{{' => '<nowiki>{{{', '}}}' => '}}}</nowiki>'));
178 - $parser = new Parser();
179 - $parser->mOptions = new ParserOptions();
180 - $parser->mOptions->initialiseFromUser($wgUser);
181 - $form_def = $parser->parse($form_def, $this->mPageTitle, $parser->mOptions)->getText();
 179+ $wgParser->mOptions = new ParserOptions();
 180+ $wgParser->mOptions->initialiseFromUser($wgUser);
 181+ $form_def = $wgParser->parse($form_def, $this->mPageTitle, $wgParser->mOptions)->getText();
182182 }
183183
184184 // turn form definition file into an array of sections, one for each

Status & tagging log