Soften test for incomplete edit POST
authorAdam Roses Wight <awight@wikimedia.org>
Thu, 5 Jun 2014 00:13:31 +0000 (17:13 -0700)
committerAwight <awight@wikimedia.org>
Thu, 5 Jun 2014 00:20:24 +0000 (00:20 +0000)
Do not reject POSTs from forms that were rendered before
wpUltimateParam was added.

There is also an open question about whether we should respect
kludgey scripts which have hardcoded form params.

See Umherirrender's comment on
change I78f1bbcc9bb092568fbfbec19c08d697c9ae75f8

Change-Id: I28bd6d45442bc3ba352f0de7a50709adb98b1c50

includes/EditPage.php

index 8f85c18..9108783 100644 (file)
@@ -799,7 +799,11 @@ class EditPage {
                        } else {
                                // If we receive the last parameter of the request, we can fairly
                                // claim the POST request has not been truncated.
-                               $this->incompleteForm = !$request->getVal( 'wpUltimateParam' );
+
+                               // TODO: softened the check for cutover.  Once we determine
+                               // that it is safe, we should complete the transition by
+                               // removing the "edittime" clause.
+                               $this->incompleteForm = ( !$request->getVal( 'wpUltimateParam' ) && is_null( $this->edittime ) );
                        }
                        if ( $this->incompleteForm ) {
                                # If the form is incomplete, force to preview.