* Temporarily set $wgTitle while doing article creation/edit updates during XML import. A null $wgTitle as in importDump.php caused a fatal error when special pages were transcluded if they did any parsing via OutputPage::parse()
) );
$revId = $revision->insertOn( $dbw );
$changed = $article->updateIfNewerOn( $dbw, $revision );
+
+ # To be on the safe side...
+ $tempTitle = $GLOBALS['wgTitle'];
+ $GLOBALS['wgTitle'] = $this->title;
if( $created ) {
wfDebug( __METHOD__ . ": running onArticleCreate\n" );
$this->timestamp,
$revId );
}
+ $GLOBALS['wgTitle'] = $tempTitle;
return true;
}
*/
public function parse( $text, $linestart = true, $interface = false ) {
global $wgParser, $wgTitle;
+ if( is_null( $wgTitle ) ) {
+ throw new MWException( 'Empty $wgTitle in ' . __METHOD__ );
+ }
$popts = $this->parserOptions();
if ( $interface) { $popts->setInterfaceMessage(true); }
$parserOutput = $wgParser->parse( $text, $wgTitle, $popts,