X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FRevision%2FRenderedRevision.php;h=c4a00545c4d3f4a7e7e6a323cf6bb77d60be7db0;hb=a9164f143a59a8d957a1d7f205715ac57fff3c8c;hp=c8f56e98dec7a1c47c8f36338cd89ec6fbcee65f;hpb=cbc61690442f21c1d20860dfdc512134ae567157;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Revision/RenderedRevision.php b/includes/Revision/RenderedRevision.php index c8f56e98de..c4a00545c4 100644 --- a/includes/Revision/RenderedRevision.php +++ b/includes/Revision/RenderedRevision.php @@ -230,6 +230,7 @@ class RenderedRevision implements SlotRenderingProvider { 'Access to the content has been suppressed for this audience' ); } else { + // XXX: allow SlotRoleHandler to control the ParserOutput? $output = $this->getSlotParserOutputUncached( $content, $withHtml ); if ( $withHtml && !$output->hasText() ) { @@ -379,9 +380,9 @@ class RenderedRevision implements SlotRenderingProvider { $method = __METHOD__; if ( $out->getFlag( 'vary-revision' ) ) { - // XXX: Would be just keep the output if the speculative revision ID was correct, - // but that can go wrong for some edge cases, like {{PAGEID}} during page creation. - // For that specific case, it would perhaps nice to have a vary-page flag. + // If {{PAGEID}} resolved to 0 or {{REVISIONTIMESTAMP}} used the current + // timestamp rather than that of an actual revision, then those words need + // to resolve to the actual page ID or revision timestamp, respectively. $this->saveParseLogger->info( "$method: Prepared output has vary-revision...\n" ); @@ -394,6 +395,14 @@ class RenderedRevision implements SlotRenderingProvider { "$method: Prepared output has vary-revision-id with wrong ID...\n" ); return true; + } elseif ( $out->getFlag( 'vary-revision-exists' ) ) { + // If {{REVISIONID}} resolved to '', it now needs to resolve to '-'. + // Note that edit stashing always uses '-', which can be used for both + // edit filter checks and canonical parser cache. + $this->saveParseLogger->info( + "$method: Prepared output has vary-revision-exists...\n" + ); + return true; } else { // NOTE: In the original fix for T135261, the output was discarded if 'vary-user' was // set for a null-edit. The reason was that the original rendering in that case was