r83240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83239‎ | r83240 | r83241 >
Date:20:16, 4 March 2011
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
* (bug 27763) Article::getParserOutput() no longer throws a fatal given when an incorrect revision ID is passed
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -4560,19 +4560,26 @@
45614561 wfIncrStats( 'pcache_miss_stub' );
45624562 }
45634563
4564 - $parserOutput = false;
45654564 if ( $useParserCache ) {
45664565 $parserOutput = ParserCache::singleton()->get( $this, $this->getParserOptions() );
 4566+ if ( $parserOutput !== false ) {
 4567+ return $parserOutput;
 4568+ }
45674569 }
45684570
4569 - if ( $parserOutput === false ) {
4570 - // Cache miss; parse and output it.
 4571+ $text = false;
 4572+ // Cache miss; parse and output it.
 4573+ if ( $oldid !== null ) {
45714574 $rev = Revision::newFromTitle( $this->getTitle(), $oldid );
 4575+ if ( $rev !== null ) {
 4576+ $text = $rev->getText();
 4577+ }
 4578+ }
 4579+ if ( $text === false ) {
 4580+ $text = $this->getRawText();
 4581+ }
45724582
4573 - return $this->getOutputFromWikitext( $rev->getText(), $useParserCache );
4574 - } else {
4575 - return $parserOutput;
4576 - }
 4583+ return $this->getOutputFromWikitext( $text, $useParserCache );
45774584 }
45784585
45794586 }
Index: trunk/phase3/RELEASE-NOTES
@@ -155,6 +155,8 @@
156156 double HTML escaped
157157 * (bug 27700) The upload protection can now also be set for files that do not
158158 exist.
 159+* (bug 27763) Article::getParserOutput() no longer throws a fatal given when an
 160+ incorrect revision ID is passed.
159161
160162 === API changes in 1.18 ===
161163 * (bug 26339) Throw warning when truncating an overlarge API result

Follow-up revisions

RevisionCommit summaryAuthorDate
r83304Follow-up r83240: seems people prefer returning false than the current versio...ialex17:55, 5 March 2011

Comments

#Comment by Platonides (talk | contribs)   23:07, 4 March 2011

I don't think this is right

$text = $this->getRawText();

It should return false, and extensions/LiquidThreads/classes/View.php:1233 handle it properly to make showPostBody() return false.

#Comment by IAlex (talk | contribs)   17:56, 5 March 2011

Done in r83304; will fix LiquidTherads later.

Status & tagging log