Index: trunk/phase3/includes/Article.php |
— | — | @@ -4560,19 +4560,26 @@ |
4561 | 4561 | wfIncrStats( 'pcache_miss_stub' ); |
4562 | 4562 | } |
4563 | 4563 | |
4564 | | - $parserOutput = false; |
4565 | 4564 | if ( $useParserCache ) { |
4566 | 4565 | $parserOutput = ParserCache::singleton()->get( $this, $this->getParserOptions() ); |
| 4566 | + if ( $parserOutput !== false ) { |
| 4567 | + return $parserOutput; |
| 4568 | + } |
4567 | 4569 | } |
4568 | 4570 | |
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 ) { |
4571 | 4574 | $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 | + } |
4572 | 4582 | |
4573 | | - return $this->getOutputFromWikitext( $rev->getText(), $useParserCache ); |
4574 | | - } else { |
4575 | | - return $parserOutput; |
4576 | | - } |
| 4583 | + return $this->getOutputFromWikitext( $text, $useParserCache ); |
4577 | 4584 | } |
4578 | 4585 | |
4579 | 4586 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -155,6 +155,8 @@ |
156 | 156 | double HTML escaped |
157 | 157 | * (bug 27700) The upload protection can now also be set for files that do not |
158 | 158 | exist. |
| 159 | +* (bug 27763) Article::getParserOutput() no longer throws a fatal given when an |
| 160 | + incorrect revision ID is passed. |
159 | 161 | |
160 | 162 | === API changes in 1.18 === |
161 | 163 | * (bug 26339) Throw warning when truncating an overlarge API result |