r69318 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69317‎ | r69318 | r69319 >
Date:22:50, 13 July 2010
Author:platonides
Status:deferred
Tags:
Comment:
Fix a couple of warnings.
*Invalid argument supplied for foreach() on line 114
*Undefined variable: currencies on line 163

This currency logic doesn't make much sense.
Modified paths:
  • /trunk/extensions/DonationInterface/donate_interface/donate_interface.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/donate_interface/donate_interface.php
@@ -106,7 +106,7 @@
107107 }
108108
109109 //get payment method gateway value and name from each gateway and create menu of options
110 - $values = '';
 110+ $values = array();
111111 wfRunHooks('DonationInterface_Value', array(&$values));
112112
113113 $gatewayMenu = '';
@@ -117,10 +117,12 @@
118118
119119 //get available currencies
120120
 121+ $currencies = array( 'USD' => "USD: U.S. Dollar" );
 122+ //FIXME: It uses the currencies of the last gateway to be loaded. It should probably use the union of currencies, (currencies allowed by any gateway).
121123 foreach($values as $key) {
122124 if (isset($key['currencies'])) {
123125 $currencies = $key['currencies'];
124 - } else { $currencies = array( 'USD' => "USD: U.S. Dollar" ); }
 126+ }
125127 }
126128
127129 $currencyMenu = '';

Status & tagging log