From a526d19f2058ee13981fafe93fa56f0c76f38db6 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 5 Mar 2011 17:55:21 +0000 Subject: [PATCH] Follow-up r83240: seems people prefer returning false than the current version when no revision with given ID is found --- includes/Article.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 85226be885..63d9bf9569 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -4543,7 +4543,7 @@ class Article { * @since 1.16 (r52326) for LiquidThreads * * @param $oldid mixed integer Revision ID or null - * @return ParserOutput + * @return ParserOutput or false if the given revsion ID is not found */ public function getParserOutput( $oldid = null ) { global $wgEnableParserCache, $wgUser; @@ -4567,16 +4567,15 @@ class Article { } } - $text = false; // Cache miss; parse and output it. - if ( $oldid !== null ) { + if ( $oldid === null ) { + $text = $this->getRawText(); + } else { $rev = Revision::newFromTitle( $this->getTitle(), $oldid ); - if ( $rev !== null ) { - $text = $rev->getText(); + if ( $rev === null ) { + return false; } - } - if ( $text === false ) { - $text = $this->getRawText(); + $text = $rev->getText(); } return $this->getOutputFromWikitext( $text, $useParserCache ); -- 2.20.1