http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82928
Revision: 82928
Author: yaron
Date: 2011-02-28 03:39:05 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
Simplified form-parsing code, to work with latest MW 1.18; hopefully this still
works with MW < 1.16
Modified Paths:
--------------
trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
Modified: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
===================================================================
--- trunk/extensions/SemanticForms/includes/SF_FormPrinter.php 2011-02-28
03:15:39 UTC (rev 82927)
+++ trunk/extensions/SemanticForms/includes/SF_FormPrinter.php 2011-02-28
03:39:05 UTC (rev 82928)
@@ -349,10 +349,9 @@
// element, so that the wiki parser won't touch it - the parser will
// remove the '<nowiki>' tags, leaving us with what we need.
$form_def = "__NOEDITSECTION__" . strtr( $form_def, array( '{{{' =>
'<nowiki>{{{', '}}}' => '}}}</nowiki>' ) );
- $old_strip_state = $wgParser->mStripState;
- $wgParser->mStripState = new StripState();
- $wgParser->mOptions = new ParserOptions();
- $wgParser->mOptions->initialiseFromUser( $wgUser );
+ if ( empty( $wgParser->mOptions ) ) {
+ $wgParser->mOptions = new ParserOptions();
+ }
// Get the form definition from the cache, if we're using caching and it's
// there.
@@ -370,7 +369,6 @@
if ( ! $got_form_def_from_cache ) {
$form_def = $wgParser->parse( $form_def, $this->mPageTitle,
$wgParser->mOptions )->getText();
}
- $wgParser->mStripState = $old_strip_state;
// turn form definition file into an array of sections, one for each
// template definition (plus the first section)
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs