From a7c837a08675866e8e607020525a4665c64f86ea Mon Sep 17 00:00:00 2001 From: Stephan Gambke Date: Sat, 24 Nov 2012 10:40:06 +0100 Subject: [PATCH] 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 --- includes/parser/Parser.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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; -- 2.20.1