Index: trunk/extensions/DonationInterface/gateway_common/GatewayForm.php |
— | — | @@ -143,14 +143,18 @@ |
144 | 144 | $this->setValidateFormResult( false ); |
145 | 145 | } |
146 | 146 | |
147 | | - if ( empty( $data['state'] ) ) { |
| 147 | + $validateState = ( $data['country'] == 'US' ) ? true : false ; |
148 | 148 | |
| 149 | + if ( empty( $data['state'] ) && $validateState ) { |
| 150 | + |
149 | 151 | $error['state'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-state' ) ); |
150 | 152 | |
151 | 153 | $this->setValidateFormResult( false ); |
152 | 154 | } |
153 | 155 | |
154 | | - if ( empty( $data['zip'] ) && $data['state'] != 'XX') { |
| 156 | + $validateZip = ( $validateState && isset( $data['state'] ) && $data['state'] != 'XX' ) ? true : false ; |
| 157 | + |
| 158 | + if ( empty( $data['zip'] ) && $validateZip ) { |
155 | 159 | |
156 | 160 | $error['zip'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-zip' ) ); |
157 | 161 | |