From: Alexandre Emsenhuber Date: Sat, 5 Mar 2011 17:55:21 +0000 (+0000) Subject: Follow-up r83240: seems people prefer returning false than the current version when... X-Git-Tag: 1.31.0-rc.0~31624 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=a526d19f2058ee13981fafe93fa56f0c76f38db6;p=lhc%2Fweb%2Fwiklou.git Follow-up r83240: seems people prefer returning false than the current version when no revision with given ID is found --- 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 );