diff --git a/ChangeLog b/ChangeLog index 4b4d1f000e..405475194f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,7 @@ phpMyAdmin - ChangeLog 4.6.6 (not yet released) - issue #12762 Fixed parsing of SQL with BINARY function +- issue #12588 ReCaptcha now works without allow_url_fopen 4.6.5.1 (2016-11-25) - issue #12735 Incorrect parameters to escapeString in Node.php diff --git a/libraries/plugins/auth/AuthenticationCookie.php b/libraries/plugins/auth/AuthenticationCookie.php index 40bb9a995f..9636ee658d 100644 --- a/libraries/plugins/auth/AuthenticationCookie.php +++ b/libraries/plugins/auth/AuthenticationCookie.php @@ -14,7 +14,7 @@ use PMA\libraries\Message; use PMA\libraries\plugins\AuthenticationPlugin; use PMA\libraries\Response; use PMA\libraries\Util; -use ReCaptcha\ReCaptcha; +use ReCaptcha; use PMA\libraries\URL; require_once './libraries/session.lib.php'; @@ -278,10 +278,22 @@ class AuthenticationCookie extends AuthenticationPlugin && ! empty($GLOBALS['cfg']['CaptchaLoginPublicKey']) ) { if (! empty($_POST["g-recaptcha-response"])) { - - $reCaptcha = new ReCaptcha( - $GLOBALS['cfg']['CaptchaLoginPrivateKey'] - ); + if (function_exists('curl_init')) { + $reCaptcha = new ReCaptcha\ReCaptcha( + $GLOBALS['cfg']['CaptchaLoginPrivateKey'], + new ReCaptcha\RequestMethod\CurlPost() + ); + } else if (ini_get('allow_url_fopen')) { + $reCaptcha = new ReCaptcha\ReCaptcha( + $GLOBALS['cfg']['CaptchaLoginPrivateKey'], + new ReCaptcha\RequestMethod\Post() + ); + } else { + $reCaptcha = new ReCaptcha\ReCaptcha( + $GLOBALS['cfg']['CaptchaLoginPrivateKey'], + new ReCaptcha\RequestMethod\SocketPost() + ); + } // verify captcha status. $resp = $reCaptcha->verify(