r75824 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75823‎ | r75824 | r75825 >
Date:20:17, 1 November 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Now pulling curl error before close curl connection so it actually works
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
@@ -1187,10 +1187,13 @@
11881188 curl_setopt( $ch, CURLOPT_POST, count( $data ) );
11891189 curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $data ) );
11901190 $curl_result = curl_exec( $ch );
 1191+ $curl_error = ( !$curl_result ) ? curl_error( $ch ) : null;
11911192 curl_close( $ch );
 1193+
11921194 // throw an exception if there was a curl error
1193 - if ( !$curl_result ) {
1194 - throw new MWException( 'There was a cURL error submitting information to ' . $wgPayflowGatewayPaypalURL . ': ' . curl_error( $ch ) );
 1195+ if ( !is_null( $curl_error ) ) {
 1196+ throw new MWException( 'There was a cURL error submitting information to ' . $wgPayflowGatewayPaypalURL . ': ' . $curl_error );
11951197 }
 1198+
11961199 }
11971200 } // end class
\ No newline at end of file

Status & tagging log