Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/197947
Change subject: Be more discriminating about the "redirect" param
......................................................................
Be more discriminating about the "redirect" param
This allows a new "redirect=0" mode, which always stops at the interstitial
page.
Always try to process immediately if the form was posted.
Bug: T92705
Change-Id: Iad802e5a70faae1f4ef3b48e14b03c485c5a2974
---
M gateway_common/GatewayPage.php
1 file changed, 13 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/47/197947/1
diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php
index 09fdd12..c01f15f 100644
--- a/gateway_common/GatewayPage.php
+++ b/gateway_common/GatewayPage.php
@@ -373,10 +373,19 @@
* @return bool True if we should attempt processing.
*/
protected function isProcessImmediate() {
- // If the user posted to this form, or we've been sent here
with an
- // immediate "redirect=1" param, try to process the transaction.
- return $this->adapter->posted
- || $this->adapter->getData_Unstaged_Escaped( 'redirect'
) === '1';
+ // If the user posted to this form, process immediately.
+ if ( $this->adapter->posted ) {
+ return true;
+ }
+
+ // Otherwise, respect the "redirect" parameter. If it is "1",
try to
+ // skip the interstitial page. If it's "0", do not process
immediately.
+ $redirect = $this->adapter->getData_Unstaged_Escaped(
'redirect' );
+ if ( $redirect !== null ) {
+ return ( $redirect === '1' || $redirect === 'true' );
+ }
+
+ return false;
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/197947
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad802e5a70faae1f4ef3b48e14b03c485c5a2974
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits