Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
BUGFIX Don't use HTTPResponse constructor to pass in message body in …
Browse files Browse the repository at this point in the history
…RecaptchaField_HTTPClient in order to stay backwards compatible with SilverStripe 2.2.x
  • Loading branch information
chillu committed Oct 8, 2010
1 parent 870e3e9 commit 9235a28
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions code/RecaptchaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ protected function recaptchaHTTPPost($challengeStr, $responseStr) {
$url = ($this->useSSL) ? 'https://' : 'http://';
$url .= self::$api_verify_server;
$response = $client->post($url, $postVars);

return $response->getBody();
}

Expand Down Expand Up @@ -369,10 +369,13 @@ function post($url, $postVars) {
$response = curl_exec($ch);

if(class_exists('SS_HTTPResponse')) {
return new SS_HTTPResponse($response);
$responseObj = new SS_HTTPResponse();
} else {
// 2.3 backwards compat
return new HTTPResponse($response);
$responseObj = new HTTPResponse();
}
$responseObj->setBody($response); // 2.2. compat

return $responseObj;
}
}

0 comments on commit 9235a28

Please sign in to comment.