Avoid setting vary-revision for {{REVISIONSIZE}}
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 10 Jun 2016 04:46:54 +0000 (21:46 -0700)
committerOri.livneh <ori@wikimedia.org>
Mon, 13 Jun 2016 23:00:05 +0000 (23:00 +0000)
Just always use the input size for new revisions. If they are
saved, then that should be the revision size. If they are just
null edits, then the size must have matched the current revision.

This also enables edit stashing for this case.

Change-Id: I428c0cc87750eeddd1d7dcebd1a2b03817cec441

includes/parser/Parser.php

index 116b274..dcc35bd 100644 (file)
@@ -2656,8 +2656,6 @@ class Parser {
                        case 'revisionsize':
                                # Let the edit saving system know we should parse the page
                                # *after* a revision ID has been assigned. This is for null edits.
-                               $this->mOutput->setFlag( 'vary-revision' );
-                               wfDebug( __METHOD__ . ": {{REVISIONSIZE}} used, setting vary-revision...\n" );
                                $value = $this->getRevisionSize();
                                break;
                        case 'namespace':
@@ -5637,7 +5635,7 @@ class Parser {
                        # will change the size.
                        if ( $revObject ) {
                                $this->mRevisionSize = $revObject->getSize();
-                       } elseif ( $this->ot['wiki'] || $this->mOptions->getIsPreview() ) {
+                       } else {
                                $this->mRevisionSize = $this->mInputSize;
                        }
                }