r100054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100053‎ | r100054 | r100055 >
Date:17:22, 17 October 2011
Author:khorn
Status:reverted (Comments)
Tags:fundraising 
Comment:
Checks to see if the array key exists, so it won't explode badly if the response was completely malformed.
r99803
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -293,7 +293,7 @@
294294
295295 function processResponse( $response ) {
296296 //set the transaction result message
297 - $responseStatus = isset( $response['STATUSID'] ) ? $response['STATUSID'] : '';
 297+ $responseStatus = array_key_exists( 'STATUSID', $response ) ? $response['STATUSID'] : 'Internal Error';
298298 $this->setTransactionResult( "Response Status: " . $responseStatus, 'txn_message' ); //TODO: Translate for GC.
299299 $this->setTransactionResult( $this->getData( 'order_id' ), 'gateway_txn_id' );
300300 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r100068Reverting my completely unnecessary r100054.khorn19:05, 17 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99803Put in a check to make sure the key (STATUSID) in the $response array exists ...jpostlethwaite20:50, 14 October 2011

Comments

#Comment by Platonides (talk | contribs)   17:30, 17 October 2011

Both lines should be equivalent (for the Notice purposes). Are you sure the error was on this line?

#Comment by Khorn (WMF) (talk | contribs)   17:47, 17 October 2011

Aw geeze: My bad. This is what happens when I try to fix a problem that went away in an update I hadn't quite done yet. Yup: This was totally unnecessary.

#Comment by Platonides (talk | contribs)   18:42, 17 October 2011

Then I think you should change it back, given that isset() is faster.

#Comment by Khorn (WMF) (talk | contribs)   18:50, 17 October 2011

Will do.

Status & tagging log