diff -r 5e7a0fedabdf -r 877f952ae2bd web/lib/Zend/Service/ReCaptcha/Response.php --- a/web/lib/Zend/Service/ReCaptcha/Response.php Thu Mar 21 17:31:31 2013 +0100 +++ b/web/lib/Zend/Service/ReCaptcha/Response.php Thu Mar 21 19:50:53 2013 +0100 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Service * @subpackage ReCaptcha - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,9 +25,9 @@ * @category Zend * @package Zend_Service * @subpackage ReCaptcha - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Response.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Response.php 25152 2012-11-28 11:55:44Z cogo $ */ class Zend_Service_ReCaptcha_Response { @@ -142,13 +142,18 @@ { $body = $response->getBody(); - $parts = explode("\n", $body, 2); + // Default status and error code + $status = 'false'; + $errorCode = ''; + + $parts = explode("\n", $body); - if (count($parts) !== 2) { - $status = 'false'; - $errorCode = ''; - } else { - list($status, $errorCode) = $parts; + if ($parts[0] === 'true') { + $status = 'true'; + } + + if (!empty($parts[1])) { + $errorCode = $parts[1]; } $this->setStatus($status); @@ -156,4 +161,4 @@ return $this; } -} \ No newline at end of file +}