Allow null for title in preprocess
authorStephan Gambke <s7eph4n@gmail.com>
Sat, 24 Nov 2012 09:40:06 +0000 (10:40 +0100)
committerStephan Gambke <s7eph4n@gmail.com>
Sat, 24 Nov 2012 09:40:06 +0000 (10:40 +0100)
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

includes/parser/Parser.php

index f664e49..d7422bc 100644 (file)
@@ -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;