jenkins-bot has submitted this change and it was merged.

Change subject: API: Fix simplified continuation module skipping
......................................................................


API: Fix simplified continuation module skipping

The simplified continuation includes a continuation parameter to
indicate when the prop/list/meta modules are complete, so it can skip
executing them.

But if someone submitted a malformed value for 'continue', it might
decide that the generator was complete but still try to uselessly
execute the prop modules.

Bug: 72764
Change-Id: I6af24e5d4f30e64782fb7dd1c2211ebdd4ec2317
(cherry picked from commit c2e6bdfce71792b97d9eb76e4ffd9b83b1af71af)
---
M includes/api/ApiQueryBase.php
M includes/api/ApiResult.php
2 files changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index b1581f3..998cc91 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -70,6 +70,10 @@
        /**
         * Override this method to request extra fields from the pageSet
         * using $pageSet->requestField('fieldName')
+        *
+        * Note this only makes sense for 'prop' modules, as 'list' and 'meta'
+        * modules should not be using the pageset.
+        *
         * @param ApiPageSet $pageSet
         */
        public function requestExtraData( $pageSet ) {
diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php
index 946977d..5bc2efb 100644
--- a/includes/api/ApiResult.php
+++ b/includes/api/ApiResult.php
@@ -481,10 +481,14 @@
                        $continue = explode( '||', $continue );
                        $this->dieContinueUsageIf( count( $continue ) !== 2 );
                        $this->generatorDone = ( $continue[0] === '-' );
+                       $skip = explode( '|', $continue[1] );
                        if ( !$this->generatorDone ) {
                                $this->generatorParams = explode( '|', 
$continue[0] );
+                       } else {
+                               // When the generator is complete, don't run 
any modules that
+                               // depend on it.
+                               $skip += $this->continueGeneratedModules;
                        }
-                       $skip = explode( '|', $continue[1] );
                }
 
                $this->continueAllModules = array();

-- 
To view, visit https://gerrit.wikimedia.org/r/171775
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6af24e5d4f30e64782fb7dd1c2211ebdd4ec2317
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.25wmf6
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to