From: Stephan Gambke Date: Sat, 24 Nov 2012 09:40:06 +0000 (+0100) Subject: Allow null for title in preprocess X-Git-Tag: 1.31.0-rc.0~21528^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=a7c837a08675866e8e607020525a4665c64f86ea;p=lhc%2Fweb%2Fwiklou.git Allow null for title in preprocess Additionally remove creation of bogus title in transformMsg. The only place preprocess uses the title is in startParse. And that explicitly allows null. Change-Id: I33d090bf250092fc541e284eb19dbd4053f40ae5 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index f664e4908c..d7422bc510 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -549,7 +549,7 @@ class Parser { * Also removes comments. * @return mixed|string */ - function preprocess( $text, Title $title, ParserOptions $options, $revid = null ) { + function preprocess( $text, Title $title = null, ParserOptions $options, $revid = null ) { wfProfileIn( __METHOD__ ); $this->startParse( $title, $options, self::OT_PREPROCESS, true ); if ( $revid !== null ) { @@ -4683,11 +4683,7 @@ class Parser { global $wgTitle; $title = $wgTitle; } - if ( !$title ) { - # It's not uncommon having a null $wgTitle in scripts. See r80898 - # Create a ghost title in such case - $title = Title::newFromText( 'Dwimmerlaik' ); - } + $text = $this->preprocess( $text, $title, $options ); $executing = false;