r75834 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75833‎ | r75834 | r75835 >
Date:21:39, 1 November 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Fixed curl handling to skip ssl host verification if we're in testing mode; Added user agent opt for curl
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -1161,7 +1161,7 @@
11621162 * This would make this a lot less hack-ish
11631163 */
11641164 public function paypalRedirect( &$data ) {
1165 - global $wgPayflowGatewayPaypalURL;
 1165+ global $wgPayflowGatewayPaypalURL, $wgPayflowGatewayTest;
11661166
11671167 // if we don't have a URL enabled throw a graceful error to the user
11681168 if ( !strlen( $wgPayflowGatewayPaypalURL ) ) {
@@ -1180,12 +1180,14 @@
11811181 $this->updateContributionTracking( $data, true );
11821182
11831183 $wgPayflowGatewayPaypalURL .= "/" . $data[ 'language' ] . "?gateway=paypal";
 1184+
11841185 // submit the data to the paypal redirect URL
1185 - // @fixme add some error checking!!!
11861186 $ch = curl_init();
11871187 curl_setopt( $ch, CURLOPT_URL, $wgPayflowGatewayPaypalURL );
 1188+ curl_setopt( $ch, CURLOPT_USERAGENT, 'Donation_Interface PayflowPro Gateway PayPal Redirecter 1.0' );
11881189 curl_setopt( $ch, CURLOPT_POST, count( $data ) );
11891190 curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $data ) );
 1191+ if ( $wgPayflowGatewayTest ) curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
11901192 $curl_result = curl_exec( $ch );
11911193 $curl_error = ( !$curl_result ) ? curl_error( $ch ) : null;
11921194 curl_close( $ch );
@@ -1196,4 +1198,4 @@
11971199 }
11981200
11991201 }
1200 -} // end class
\ No newline at end of file
 1202+} // end class

Status & tagging log