http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88765

Revision: 88765
Author:   brion
Date:     2011-05-24 23:12:34 +0000 (Tue, 24 May 2011)
Log Message:
-----------
Hackaround for unstubbing order problem on $wgParser as ref'd from opensearchxml

We were setting $wgParser->mOptions then calling $wgParser->clearState(); this 
caused unstubbing to happen at the _call_ if it hadn't been previously 
unstubbed, leaving the mOptions blank and, with current code, thus exploding 
due to the missing mOptions.
Forcing setTitle first gets it going, but isn't very pretty. Should probably be 
rewritten more cleanly.

Modified Paths:
--------------
    trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php

Modified: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php
===================================================================
--- trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php 2011-05-24 22:56:42 UTC 
(rev 88764)
+++ trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php 2011-05-24 23:12:34 UTC 
(rev 88765)
@@ -264,6 +264,7 @@
                        // First, we use the system preprocessor to break down 
the text
                        // into text, templates, extensions, and comments:
                        global $wgParser;
+                       $wgParser->setTitle( $title ); // force an unstub 
before the below...
                        $wgParser->mOptions = new ParserOptions();
                        $wgParser->clearState();
                        $frame = $wgParser->getPreprocessor()->newFrame();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to