r76554 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76553‎ | r76554 | r76555 >
Date:00:56, 12 November 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Modified curl settings to play nice with reCaptcha, added some more logging
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/extras/recaptcha/recaptcha-php/recaptchalib.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/extras/recaptcha/recaptcha-php/recaptchalib.php
@@ -149,7 +149,7 @@
150150 * @return array response
151151 */
152152 function _recaptcha_http_post_curl( $host, $path, $data, $port = 80 ) {
153 - $url = RECAPTCHA_PROTOCOL . "://" . $host . ":" . $port;
 153+ $url = "http://" . $host . ":" . $port;
154154
155155 $ch = curl_init( $url );
156156 curl_setopt( $ch, CURLOPT_POST, true );
@@ -162,13 +162,14 @@
163163
164164 // set proxy settings if necessary
165165 if ( RECAPTCHA_USE_HTTP_PROXY ) {
166 - curl_setopt( $ch, CURLOPT_HTTPPROXYTUNNEL, 1 );
 166+ wfDebugLog( 'payflowpro_gateway', 'Using http proxy ' . RECAPTCHA_HTTP_PROXY );
 167+ curl_setopt( $ch, CURLPROXY_HTTP );
167168 curl_setopt( $ch, CURLOPT_PROXY, RECAPTCHA_HTTP_PROXY );
168169 }
169170
170171 // try up to three times
171172 for ( $i = 0; $i < RECAPTCHA_RETRY_LIMIT; $i++ ) {
172 - wfDebugLog( 'payflowpro_gateway', 'Preparing to communicate with reCaptcha via cURL.' );
 173+ wfDebugLog( 'payflowpro_gateway', 'Preparing to communicate with reCaptcha via cURL at ' . $url . '.' );
173174 $response = curl_exec( $ch );
174175 wfDebugLog( 'payflowpro_gateway', "Finished communicating with reCaptcha." );
175176 if ( $response ) {
@@ -188,7 +189,7 @@
189190 */
190191 if ( !$response ) {
191192 wfDebugLog( 'payflowpro_gateway', 'Failed communicating with reCaptcha: ' . curl_error( $ch ) );
192 - $response = "true\r\n\r\ntrue";
 193+ $response = "true\r\n\r\nsuccess";
193194 }
194195
195196 return $response;

Status & tagging log