r99281 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99280‎ | r99281 | r99282 >
Date:23:30, 7 October 2011
Author:khorn
Status:ok
Tags:fundraising 
Comment:
Killed the wasPosted function in DonationData, in favor of using the real one.
r96927
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/gateway_common/DonationData.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -150,6 +150,7 @@
151151 * @see DonationData
152152 */
153153 public function __construct( $options = array() ) {
 154+ global $wgRequest;
154155
155156 // Extract the options
156157 extract( $options );
@@ -175,7 +176,7 @@
176177
177178 $this->postdata = $this->dataObj->getData();
178179 //TODO: Fix this a bit.
179 - $this->posted = $this->dataObj->wasPosted();
 180+ $this->posted = $wgRequest->wasPosted();
180181
181182 $this->setPostDefaults( $postDefaults );
182183 $this->defineTransactions();
Index: branches/fundraising/extensions/DonationInterface/gateway_common/DonationData.php
@@ -424,6 +424,7 @@
425425 }
426426
427427 public function checkTokens() {
 428+ global $wgRequest;
428429 static $match = null;
429430
430431 if ( $match === null ) {
@@ -440,7 +441,7 @@
441442 // match token
442443 $token_check = ( $this->isSomething( 'token' ) ) ? $this->getVal( 'token' ) : $token; //TODO: does this suck as much as it looks like it does?
443444 $match = $this->matchEditToken( $token_check, $salt );
444 - if ( $this->wasPosted() ) {
 445+ if ( $wgRequest->wasPosted() ) {
445446 $this->log( $this->getAnnoyingOrderIDLogLinePrefix() . ' Submitted edit token: ' . $this->getVal( 'token' ), LOG_DEBUG );
446447 $this->log( $this->getAnnoyingOrderIDLogLinePrefix() . ' Token match: ' . ($match ? 'true' : 'false' ), LOG_DEBUG );
447448 }
@@ -449,14 +450,6 @@
450451 return $match;
451452 }
452453
453 - function wasPosted() {
454 - //TODO: Get rid of these log statements.
455 - if ( $this->isSomething( 'posted' ) ) {
456 - return true;
457 - }
458 - return false;
459 - }
460 -
461454 /**
462455 * Get the utm_source string
463456 *

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96927Mods to make the DonationInterface tests accurate again.Fundraiser Card #285...khorn22:33, 12 September 2011

Status & tagging log