From 93c6491a09eb1f6652ac51b5cbf74abe0cee7467 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Sat, 21 May 2005 17:26:42 +0000 Subject: [PATCH] PHP4 doesn't like null references, so splitting function --- includes/Article.php | 2 +- includes/OutputPage.php | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 4f080c58ac..328cd6d48d 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1213,7 +1213,7 @@ class Article { # than the currently displayed one (e.g. image pages # craeted on file uploads); otherwise, link updates will # go wrong. - $wgOut->addWikiText( $text, true, $this->mTitle ); + $wgOut->addWikiTextWithTitle( $text, true, $this->mTitle ); # Look up the links in the DB and add them to the link cache $wgOut->transformBuffer( RLH_FOR_UPDATE ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 8b21f534c0..28f3b3972b 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -227,16 +227,27 @@ class OutputPage { /** * Convert wikitext to HTML and add it to the buffer + * Default assumes that the current page title will + * be used. */ - function addWikiText( $text, $linestart = true, &$titleObj=false ) { - global $wgParser, $wgTitle, $wgUseTidy; - $title = $titleObj ? $titleObj : $wgTitle; + function addWikiText( $text, $linestart = true ) { + global $wgTitle; + $this->addWikiTextTitle($text, $linestart, $wgTitle); + } + + function addWikiTextWithTitle($text, $linestart = true, &$title) { + $this->addWikiTextTitle($text, $linestart, $title); + } + + function addWikiTextTitle($text, $linestart, &$title) { + global $wgParser, $wgUseTidy; $parserOutput = $wgParser->parse( $text, $title, $this->mParserOptions, $linestart ); $this->mLanguageLinks += $parserOutput->getLanguageLinks(); $this->mCategoryLinks += $parserOutput->getCategoryLinks(); $this->addHTML( $parserOutput->getText() ); - } - + + } + /** * Add wikitext to the buffer, assuming that this is the primary text for a page view * Saves the text into the parser cache if possible -- 2.20.1