From e631e8d05ee161ba0790986062f900cdb3ad9d6a Mon Sep 17 00:00:00 2001 From: Brian Canini <canini.16@osu.edu> Date: Thu, 1 Apr 2021 12:04:58 -0400 Subject: [PATCH] Updating drupal/recaptcha (2.5.0 => 3.0.0) --- composer.json | 2 +- composer.lock | 35 ++- vendor/composer/installed.json | 35 ++- web/modules/recaptcha/.eslintignore | 1 - web/modules/recaptcha/composer.json | 3 +- web/modules/recaptcha/phpcs.xml.dist | 2 - .../recaptcha-php/src/ReCaptcha/ReCaptcha.php | 261 ------------------ .../src/ReCaptcha/RequestMethod.php | 42 --- .../src/ReCaptcha/RequestMethod/Curl.php | 74 ----- .../src/ReCaptcha/RequestMethod/CurlPost.php | 96 ------- .../src/ReCaptcha/RequestMethod/Post.php | 80 ------ .../src/ReCaptcha/RequestMethod/Socket.php | 104 ------- .../ReCaptcha/RequestMethod/SocketPost.php | 100 ------- .../src/ReCaptcha/RequestParameters.php | 103 ------- .../recaptcha-php/src/ReCaptcha/Response.php | 210 -------------- .../recaptcha/recaptcha-php/src/autoload.php | 40 --- web/modules/recaptcha/recaptcha.info.yml | 7 +- web/modules/recaptcha/recaptcha.module | 8 +- .../ReCaptcha/RequestMethod/Drupal8Post.php | 2 +- .../src/Functional/ReCaptchaBasicTest.php | 5 + 20 files changed, 66 insertions(+), 1144 deletions(-) delete mode 100644 web/modules/recaptcha/.eslintignore delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/ReCaptcha.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Curl.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/CurlPost.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Post.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Socket.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/SocketPost.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestParameters.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/ReCaptcha/Response.php delete mode 100644 web/modules/recaptcha/recaptcha-php/src/autoload.php diff --git a/composer.json b/composer.json index 6cbab83069..82331db48a 100644 --- a/composer.json +++ b/composer.json @@ -156,7 +156,7 @@ "drupal/pathauto": "1.8", "drupal/realname": "1.0.0-rc2", "drupal/rebuild_cache_access": "1.7", - "drupal/recaptcha": "2.5", + "drupal/recaptcha": "3.0", "drupal/recaptcha_v3": "^1.4", "drupal/redirect": "1.6", "drupal/redis": "1.0", diff --git a/composer.lock b/composer.lock index dbbccb9f01..dc7547716e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3e92f2c0ff2c82016b011d0962b739ff", + "content-hash": "f679b46600fe3368251b7644ee82ef2d", "packages": [ { "name": "alchemy/zippy", @@ -6936,27 +6936,28 @@ }, { "name": "drupal/recaptcha", - "version": "2.5.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/recaptcha.git", - "reference": "8.x-2.5" + "reference": "8.x-3.0" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/recaptcha-8.x-2.5.zip", - "reference": "8.x-2.5", - "shasum": "ffc4e334c2b09cb04b75fa9e0df3f63d1ebde0bc" + "url": "https://ftp.drupal.org/files/projects/recaptcha-8.x-3.0.zip", + "reference": "8.x-3.0", + "shasum": "5f1b179184b105ad6c121ab5505054e1e99331b9" }, "require": { "drupal/captcha": "^1.0.0-alpha1", - "drupal/core": "~8.0" + "drupal/core": "^8 || ^9", + "google/recaptcha": "^1.2" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-2.5", - "datestamp": "1580340616", + "version": "8.x-3.0", + "datestamp": "1591216085", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -6976,6 +6977,10 @@ "name": "See other contributors", "homepage": "https://www.drupal.org/node/147903/committers" }, + { + "name": "amykhailova", + "homepage": "https://www.drupal.org/user/2892725" + }, { "name": "diolan", "homepage": "https://www.drupal.org/user/2336786" @@ -6991,6 +6996,18 @@ { "name": "kim.pepper", "homepage": "https://www.drupal.org/user/370574" + }, + { + "name": "rfay", + "homepage": "https://www.drupal.org/user/30906" + }, + { + "name": "soxofaan", + "homepage": "https://www.drupal.org/user/41478" + }, + { + "name": "wundo", + "homepage": "https://www.drupal.org/user/25523" } ], "description": "Protect your website from spam and abuse while letting real people pass through with ease.", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ebcc3b32e9..64fc86fad9 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -7148,28 +7148,29 @@ }, { "name": "drupal/recaptcha", - "version": "2.5.0", - "version_normalized": "2.5.0.0", + "version": "3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/recaptcha.git", - "reference": "8.x-2.5" + "reference": "8.x-3.0" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/recaptcha-8.x-2.5.zip", - "reference": "8.x-2.5", - "shasum": "ffc4e334c2b09cb04b75fa9e0df3f63d1ebde0bc" + "url": "https://ftp.drupal.org/files/projects/recaptcha-8.x-3.0.zip", + "reference": "8.x-3.0", + "shasum": "5f1b179184b105ad6c121ab5505054e1e99331b9" }, "require": { "drupal/captcha": "^1.0.0-alpha1", - "drupal/core": "~8.0" + "drupal/core": "^8 || ^9", + "google/recaptcha": "^1.2" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-2.5", - "datestamp": "1580340616", + "version": "8.x-3.0", + "datestamp": "1591216085", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7190,6 +7191,10 @@ "name": "See other contributors", "homepage": "https://www.drupal.org/node/147903/committers" }, + { + "name": "amykhailova", + "homepage": "https://www.drupal.org/user/2892725" + }, { "name": "diolan", "homepage": "https://www.drupal.org/user/2336786" @@ -7205,6 +7210,18 @@ { "name": "kim.pepper", "homepage": "https://www.drupal.org/user/370574" + }, + { + "name": "rfay", + "homepage": "https://www.drupal.org/user/30906" + }, + { + "name": "soxofaan", + "homepage": "https://www.drupal.org/user/41478" + }, + { + "name": "wundo", + "homepage": "https://www.drupal.org/user/25523" } ], "description": "Protect your website from spam and abuse while letting real people pass through with ease.", diff --git a/web/modules/recaptcha/.eslintignore b/web/modules/recaptcha/.eslintignore deleted file mode 100644 index a253fe8158..0000000000 --- a/web/modules/recaptcha/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -recaptcha-php/** diff --git a/web/modules/recaptcha/composer.json b/web/modules/recaptcha/composer.json index c4d75d37ee..e51d87e801 100644 --- a/web/modules/recaptcha/composer.json +++ b/web/modules/recaptcha/composer.json @@ -19,6 +19,7 @@ }, "license": "GPL-2.0+", "require": { - "drupal/captcha": "^1.0.0-alpha1" + "drupal/captcha": "^1.0.0-alpha1", + "google/recaptcha": "^1.2" } } diff --git a/web/modules/recaptcha/phpcs.xml.dist b/web/modules/recaptcha/phpcs.xml.dist index 73ef67a438..914c4a86f0 100644 --- a/web/modules/recaptcha/phpcs.xml.dist +++ b/web/modules/recaptcha/phpcs.xml.dist @@ -7,6 +7,4 @@ <!-- Include existing standards. --> <rule ref="Drupal"/> <rule ref="DrupalPractice"/> - - <exclude-pattern>recaptcha-php/*</exclude-pattern> </ruleset> \ No newline at end of file diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/ReCaptcha.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/ReCaptcha.php deleted file mode 100644 index 8939e84b03..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/ReCaptcha.php +++ /dev/null @@ -1,261 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha; - -/** - * reCAPTCHA client. - */ -class ReCaptcha -{ - /** - * Version of this client library. - * @const string - */ - const VERSION = 'php_1.2.1'; - - /** - * URL for reCAPTCHA sitevrerify API - * @const string - */ - const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'; - - /** - * Invalid JSON received - * @const string - */ - const E_INVALID_JSON = 'invalid-json'; - - /** - * Could not connect to service - * @const string - */ - const E_CONNECTION_FAILED = 'connection-failed'; - - /** - * Did not receive a 200 from the service - * @const string - */ - const E_BAD_RESPONSE = 'bad-response'; - - /** - * Not a success, but no error codes received! - * @const string - */ - const E_UNKNOWN_ERROR = 'unknown-error'; - - /** - * ReCAPTCHA response not provided - * @const string - */ - const E_MISSING_INPUT_RESPONSE = 'missing-input-response'; - - /** - * Expected hostname did not match - * @const string - */ - const E_HOSTNAME_MISMATCH = 'hostname-mismatch'; - - /** - * Expected APK package name did not match - * @const string - */ - const E_APK_PACKAGE_NAME_MISMATCH = 'apk_package_name-mismatch'; - - /** - * Expected action did not match - * @const string - */ - const E_ACTION_MISMATCH = 'action-mismatch'; - - /** - * Score threshold not met - * @const string - */ - const E_SCORE_THRESHOLD_NOT_MET = 'score-threshold-not-met'; - - /** - * Challenge timeout - * @const string - */ - const E_CHALLENGE_TIMEOUT = 'challenge-timeout'; - - /** - * Shared secret for the site. - * @var string - */ - private $secret; - - /** - * Method used to communicate with service. Defaults to POST request. - * @var RequestMethod - */ - private $requestMethod; - - /** - * Create a configured instance to use the reCAPTCHA service. - * - * @param string $secret The shared key between your site and reCAPTCHA. - * @param RequestMethod $requestMethod method used to send the request. Defaults to POST. - * @throws \RuntimeException if $secret is invalid - */ - public function __construct($secret, RequestMethod $requestMethod = null) - { - if (empty($secret)) { - throw new \RuntimeException('No secret provided'); - } - - if (!is_string($secret)) { - throw new \RuntimeException('The provided secret must be a string'); - } - - $this->secret = $secret; - $this->requestMethod = (is_null($requestMethod)) ? new RequestMethod\Post() : $requestMethod; - } - - /** - * Calls the reCAPTCHA siteverify API to verify whether the user passes - * CAPTCHA test and additionally runs any specified additional checks - * - * @param string $response The user response token provided by reCAPTCHA, verifying the user on your site. - * @param string $remoteIp The end user's IP address. - * @return Response Response from the service. - */ - public function verify($response, $remoteIp = null) - { - // Discard empty solution submissions - if (empty($response)) { - $recaptchaResponse = new Response(false, array(self::E_MISSING_INPUT_RESPONSE)); - return $recaptchaResponse; - } - - $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION); - $rawResponse = $this->requestMethod->submit($params); - $initialResponse = Response::fromJson($rawResponse); - $validationErrors = array(); - - if (isset($this->hostname) && strcasecmp($this->hostname, $initialResponse->getHostname()) !== 0) { - $validationErrors[] = self::E_HOSTNAME_MISMATCH; - } - - if (isset($this->apkPackageName) && strcasecmp($this->apkPackageName, $initialResponse->getApkPackageName()) !== 0) { - $validationErrors[] = self::E_APK_PACKAGE_NAME_MISMATCH; - } - - if (isset($this->action) && strcasecmp($this->action, $initialResponse->getAction()) !== 0) { - $validationErrors[] = self::E_ACTION_MISMATCH; - } - - if (isset($this->threshold) && $this->threshold > $initialResponse->getScore()) { - $validationErrors[] = self::E_SCORE_THRESHOLD_NOT_MET; - } - - if (isset($this->timeoutSeconds)) { - $challengeTs = strtotime($initialResponse->getChallengeTs()); - - if ($challengeTs > 0 && time() - $challengeTs > $this->timeoutSeconds) { - $validationErrors[] = self::E_CHALLENGE_TIMEOUT; - } - } - - if (empty($validationErrors)) { - return $initialResponse; - } - - return new Response( - false, - array_merge($initialResponse->getErrorCodes(), $validationErrors), - $initialResponse->getHostname(), - $initialResponse->getChallengeTs(), - $initialResponse->getApkPackageName(), - $initialResponse->getScore(), - $initialResponse->getAction() - ); - } - - /** - * Provide a hostname to match against in verify() - * This should be without a protocol or trailing slash, e.g. www.google.com - * - * @param string $hostname Expected hostname - * @return ReCaptcha Current instance for fluent interface - */ - public function setExpectedHostname($hostname) - { - $this->hostname = $hostname; - return $this; - } - - /** - * Provide an APK package name to match against in verify() - * - * @param string $apkPackageName Expected APK package name - * @return ReCaptcha Current instance for fluent interface - */ - public function setExpectedApkPackageName($apkPackageName) - { - $this->apkPackageName = $apkPackageName; - return $this; - } - - /** - * Provide an action to match against in verify() - * This should be set per page. - * - * @param string $action Expected action - * @return ReCaptcha Current instance for fluent interface - */ - public function setExpectedAction($action) - { - $this->action = $action; - return $this; - } - - /** - * Provide a threshold to meet or exceed in verify() - * Threshold should be a float between 0 and 1 which will be tested as response >= threshold. - * - * @param float $threshold Expected threshold - * @return ReCaptcha Current instance for fluent interface - */ - public function setScoreThreshold($threshold) - { - $this->threshold = floatval($threshold); - return $this; - } - - /** - * Provide a timeout in seconds to test against the challenge timestamp in verify() - * - * @param int $timeoutSeconds Expected hostname - * @return ReCaptcha Current instance for fluent interface - */ - public function setChallengeTimeout($timeoutSeconds) - { - $this->timeoutSeconds = $timeoutSeconds; - return $this; - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod.php deleted file mode 100644 index 2fd94b3b14..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha; - -/** - * Method used to send the request to the service. - */ -interface RequestMethod -{ - - /** - * Submit the request with the specified parameters. - * - * @param RequestParameters $params Request parameters - * @return string Body of the reCAPTCHA response - */ - public function submit(RequestParameters $params); -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Curl.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Curl.php deleted file mode 100644 index 3d8dddd160..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Curl.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha\RequestMethod; - -/** - * Convenience wrapper around the cURL functions to allow mocking. - */ -class Curl -{ - - /** - * @see http://php.net/curl_init - * @param string $url - * @return resource cURL handle - */ - public function init($url = null) - { - return curl_init($url); - } - - /** - * @see http://php.net/curl_setopt_array - * @param resource $ch - * @param array $options - * @return bool - */ - public function setoptArray($ch, array $options) - { - return curl_setopt_array($ch, $options); - } - - /** - * @see http://php.net/curl_exec - * @param resource $ch - * @return mixed - */ - public function exec($ch) - { - return curl_exec($ch); - } - - /** - * @see http://php.net/curl_close - * @param resource $ch - */ - public function close($ch) - { - curl_close($ch); - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/CurlPost.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/CurlPost.php deleted file mode 100644 index 59886f8ab4..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/CurlPost.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha\RequestMethod; - -use ReCaptcha\ReCaptcha; -use ReCaptcha\RequestMethod; -use ReCaptcha\RequestParameters; - -/** - * Sends cURL request to the reCAPTCHA service. - * Note: this requires the cURL extension to be enabled in PHP - * @see http://php.net/manual/en/book.curl.php - */ -class CurlPost implements RequestMethod -{ - /** - * Curl connection to the reCAPTCHA service - * @var Curl - */ - private $curl; - - /** - * URL for reCAPTCHA sitevrerify API - * @var string - */ - private $siteVerifyUrl; - - /** - * Only needed if you want to override the defaults - * - * @param Curl $curl Curl resource - * @param string $siteVerifyUrl URL for reCAPTCHA sitevrerify API - */ - public function __construct(Curl $curl = null, $siteVerifyUrl = null) - { - $this->curl = (is_null($curl)) ? new Curl() : $curl; - $this->siteVerifyUrl = (is_null($siteVerifyUrl)) ? ReCaptcha::SITE_VERIFY_URL : $siteVerifyUrl; - } - - /** - * Submit the cURL request with the specified parameters. - * - * @param RequestParameters $params Request parameters - * @return string Body of the reCAPTCHA response - */ - public function submit(RequestParameters $params) - { - $handle = $this->curl->init($this->siteVerifyUrl); - - $options = array( - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => $params->toQueryString(), - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/x-www-form-urlencoded' - ), - CURLINFO_HEADER_OUT => false, - CURLOPT_HEADER => false, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_SSL_VERIFYPEER => true - ); - $this->curl->setoptArray($handle, $options); - - $response = $this->curl->exec($handle); - $this->curl->close($handle); - - if ($response !== false) { - return $response; - } - - return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}'; - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Post.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Post.php deleted file mode 100644 index 9e26582177..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Post.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha\RequestMethod; - -use ReCaptcha\ReCaptcha; -use ReCaptcha\RequestMethod; -use ReCaptcha\RequestParameters; - -/** - * Sends POST requests to the reCAPTCHA service. - */ -class Post implements RequestMethod -{ - /** - * URL for reCAPTCHA sitevrerify API - * @var string - */ - private $siteVerifyUrl; - - /** - * Only needed if you want to override the defaults - * - * @param string $siteVerifyUrl URL for reCAPTCHA sitevrerify API - */ - public function __construct($siteVerifyUrl = null) - { - $this->siteVerifyUrl = (is_null($siteVerifyUrl)) ? ReCaptcha::SITE_VERIFY_URL : $siteVerifyUrl; - } - - /** - * Submit the POST request with the specified parameters. - * - * @param RequestParameters $params Request parameters - * @return string Body of the reCAPTCHA response - */ - public function submit(RequestParameters $params) - { - $options = array( - 'http' => array( - 'header' => "Content-type: application/x-www-form-urlencoded\r\n", - 'method' => 'POST', - 'content' => $params->toQueryString(), - // Force the peer to validate (not needed in 5.6.0+, but still works) - 'verify_peer' => true, - ), - ); - $context = stream_context_create($options); - $response = file_get_contents($this->siteVerifyUrl, false, $context); - - if ($response !== false) { - return $response; - } - - return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}'; - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Socket.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Socket.php deleted file mode 100644 index 12322e8c0a..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/Socket.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha\RequestMethod; - -/** - * Convenience wrapper around native socket and file functions to allow for - * mocking. - */ -class Socket -{ - private $handle = null; - - /** - * fsockopen - * - * @see http://php.net/fsockopen - * @param string $hostname - * @param int $port - * @param int $errno - * @param string $errstr - * @param float $timeout - * @return resource - */ - public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null) - { - $this->handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout)); - - if ($this->handle != false && $errno === 0 && $errstr === '') { - return $this->handle; - } - return false; - } - - /** - * fwrite - * - * @see http://php.net/fwrite - * @param string $string - * @param int $length - * @return int | bool - */ - public function fwrite($string, $length = null) - { - return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length)); - } - - /** - * fgets - * - * @see http://php.net/fgets - * @param int $length - * @return string - */ - public function fgets($length = null) - { - return fgets($this->handle, $length); - } - - /** - * feof - * - * @see http://php.net/feof - * @return bool - */ - public function feof() - { - return feof($this->handle); - } - - /** - * fclose - * - * @see http://php.net/fclose - * @return bool - */ - public function fclose() - { - return fclose($this->handle); - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/SocketPost.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/SocketPost.php deleted file mode 100644 index ca1ca907b2..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestMethod/SocketPost.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha\RequestMethod; - -use ReCaptcha\ReCaptcha; -use ReCaptcha\RequestMethod; -use ReCaptcha\RequestParameters; - -/** - * Sends a POST request to the reCAPTCHA service, but makes use of fsockopen() - * instead of get_file_contents(). This is to account for people who may be on - * servers where allow_url_open is disabled. - */ -class SocketPost implements RequestMethod -{ - /** - * Socket to the reCAPTCHA service - * @var Socket - */ - private $socket; - - /** - * Only needed if you want to override the defaults - * - * @param \ReCaptcha\RequestMethod\Socket $socket optional socket, injectable for testing - * @param string $siteVerifyUrl URL for reCAPTCHA sitevrerify API - */ - public function __construct(Socket $socket = null, $siteVerifyUrl = null) - { - $this->socket = (is_null($socket)) ? new Socket() : $socket; - $this->siteVerifyUrl = (is_null($siteVerifyUrl)) ? ReCaptcha::SITE_VERIFY_URL : $siteVerifyUrl; - } - - /** - * Submit the POST request with the specified parameters. - * - * @param RequestParameters $params Request parameters - * @return string Body of the reCAPTCHA response - */ - public function submit(RequestParameters $params) - { - $errno = 0; - $errstr = ''; - $urlParsed = parse_url($this->siteVerifyUrl); - - if (false === $this->socket->fsockopen('ssl://' . $urlParsed['host'], 443, $errno, $errstr, 30)) { - return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}'; - } - - $content = $params->toQueryString(); - - $request = "POST " . $urlParsed['path'] . " HTTP/1.1\r\n"; - $request .= "Host: " . $urlParsed['host'] . "\r\n"; - $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $request .= "Content-length: " . strlen($content) . "\r\n"; - $request .= "Connection: close\r\n\r\n"; - $request .= $content . "\r\n\r\n"; - - $this->socket->fwrite($request); - $response = ''; - - while (!$this->socket->feof()) { - $response .= $this->socket->fgets(4096); - } - - $this->socket->fclose(); - - if (0 !== strpos($response, 'HTTP/1.1 200 OK')) { - return '{"success": false, "error-codes": ["'.ReCaptcha::E_BAD_RESPONSE.'"]}'; - } - - $parts = preg_split("#\n\s*\n#Uis", $response); - - return $parts[1]; - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestParameters.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestParameters.php deleted file mode 100644 index b6dd998d8e..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/RequestParameters.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha; - -/** - * Stores and formats the parameters for the request to the reCAPTCHA service. - */ -class RequestParameters -{ - /** - * The shared key between your site and reCAPTCHA. - * @var string - */ - private $secret; - - /** - * The user response token provided by reCAPTCHA, verifying the user on your site. - * @var string - */ - private $response; - - /** - * Remote user's IP address. - * @var string - */ - private $remoteIp; - - /** - * Client version. - * @var string - */ - private $version; - - /** - * Initialise parameters. - * - * @param string $secret Site secret. - * @param string $response Value from g-captcha-response form field. - * @param string $remoteIp User's IP address. - * @param string $version Version of this client library. - */ - public function __construct($secret, $response, $remoteIp = null, $version = null) - { - $this->secret = $secret; - $this->response = $response; - $this->remoteIp = $remoteIp; - $this->version = $version; - } - - /** - * Array representation. - * - * @return array Array formatted parameters. - */ - public function toArray() - { - $params = array('secret' => $this->secret, 'response' => $this->response); - - if (!is_null($this->remoteIp)) { - $params['remoteip'] = $this->remoteIp; - } - - if (!is_null($this->version)) { - $params['version'] = $this->version; - } - - return $params; - } - - /** - * Query string representation for HTTP request. - * - * @return string Query string formatted parameters. - */ - public function toQueryString() - { - return http_build_query($this->toArray(), '', '&'); - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/Response.php b/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/Response.php deleted file mode 100644 index 5c15c372cb..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/ReCaptcha/Response.php +++ /dev/null @@ -1,210 +0,0 @@ -<?php -/** - * This is a PHP library that handles calling reCAPTCHA. - * - * @copyright Copyright (c) 2015, Google Inc. - * @link https://www.google.com/recaptcha - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -namespace ReCaptcha; - -/** - * The response returned from the service. - */ -class Response -{ - /** - * Success or failure. - * @var boolean - */ - private $success = false; - - /** - * Error code strings. - * @var array - */ - private $errorCodes = array(); - - /** - * The hostname of the site where the reCAPTCHA was solved. - * @var string - */ - private $hostname; - - /** - * Timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ) - * @var string - */ - private $challengeTs; - - /** - * APK package name - * @var string - */ - private $apkPackageName; - - /** - * Score assigned to the request - * @var float - */ - private $score; - - /** - * Action as specified by the page - * @var string - */ - private $action; - - /** - * Build the response from the expected JSON returned by the service. - * - * @param string $json - * @return \ReCaptcha\Response - */ - public static function fromJson($json) - { - $responseData = json_decode($json, true); - - if (!$responseData) { - return new Response(false, array(ReCaptcha::E_INVALID_JSON)); - } - - $hostname = isset($responseData['hostname']) ? $responseData['hostname'] : null; - $challengeTs = isset($responseData['challenge_ts']) ? $responseData['challenge_ts'] : null; - $apkPackageName = isset($responseData['apk_package_name']) ? $responseData['apk_package_name'] : null; - $score = isset($responseData['score']) ? floatval($responseData['score']) : null; - $action = isset($responseData['action']) ? $responseData['action'] : null; - - if (isset($responseData['success']) && $responseData['success'] == true) { - return new Response(true, array(), $hostname, $challengeTs, $apkPackageName, $score, $action); - } - - if (isset($responseData['error-codes']) && is_array($responseData['error-codes'])) { - return new Response(false, $responseData['error-codes'], $hostname, $challengeTs, $apkPackageName, $score, $action); - } - - return new Response(false, array(ReCaptcha::E_UNKNOWN_ERROR), $hostname, $challengeTs, $apkPackageName, $score, $action); - } - - /** - * Constructor. - * - * @param boolean $success - * @param string $hostname - * @param string $challengeTs - * @param string $apkPackageName - * @param float $score - * @param strong $action - * @param array $errorCodes - */ - public function __construct($success, array $errorCodes = array(), $hostname = null, $challengeTs = null, $apkPackageName = null, $score = null, $action = null) - { - $this->success = $success; - $this->hostname = $hostname; - $this->challengeTs = $challengeTs; - $this->apkPackageName = $apkPackageName; - $this->score = $score; - $this->action = $action; - $this->errorCodes = $errorCodes; - } - - /** - * Is success? - * - * @return boolean - */ - public function isSuccess() - { - return $this->success; - } - - /** - * Get error codes. - * - * @return array - */ - public function getErrorCodes() - { - return $this->errorCodes; - } - - /** - * Get hostname. - * - * @return string - */ - public function getHostname() - { - return $this->hostname; - } - - /** - * Get challenge timestamp - * - * @return string - */ - public function getChallengeTs() - { - return $this->challengeTs; - } - - /** - * Get APK package name - * - * @return string - */ - public function getApkPackageName() - { - return $this->apkPackageName; - } - /** - * Get score - * - * @return float - */ - public function getScore() - { - return $this->score; - } - - /** - * Get action - * - * @return string - */ - public function getAction() - { - return $this->action; - } - - public function toArray() - { - return array( - 'success' => $this->isSuccess(), - 'hostname' => $this->getHostname(), - 'challenge_ts' => $this->getChallengeTs(), - 'apk_package_name' => $this->getApkPackageName(), - 'score' => $this->getScore(), - 'action' => $this->getAction(), - 'error-codes' => $this->getErrorCodes(), - ); - } -} diff --git a/web/modules/recaptcha/recaptcha-php/src/autoload.php b/web/modules/recaptcha/recaptcha-php/src/autoload.php deleted file mode 100644 index 95e249e959..0000000000 --- a/web/modules/recaptcha/recaptcha-php/src/autoload.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* An autoloader for ReCaptcha\Foo classes. This should be required() - * by the user before attempting to instantiate any of the ReCaptcha - * classes. - */ - -spl_autoload_register(function ($class) { - if (substr($class, 0, 10) !== 'ReCaptcha\\') { - /* If the class does not lie under the "ReCaptcha" namespace, - * then we can exit immediately. - */ - return; - } - - /* All of the classes have names like "ReCaptcha\Foo", so we need - * to replace the backslashes with frontslashes if we want the - * name to map directly to a location in the filesystem. - */ - $class = str_replace('\\', '/', $class); - - /* First, check under the current directory. It is important that - * we look here first, so that we don't waste time searching for - * test classes in the common case. - */ - $path = dirname(__FILE__).'/'.$class.'.php'; - if (is_readable($path)) { - require_once $path; - - return; - } - - /* If we didn't find what we're looking for already, maybe it's - * a test class? - */ - $path = dirname(__FILE__).'/../tests/'.$class.'.php'; - if (is_readable($path)) { - require_once $path; - } -}); diff --git a/web/modules/recaptcha/recaptcha.info.yml b/web/modules/recaptcha/recaptcha.info.yml index 08ed1c44bb..2e36571078 100644 --- a/web/modules/recaptcha/recaptcha.info.yml +++ b/web/modules/recaptcha/recaptcha.info.yml @@ -3,11 +3,12 @@ type: module description: 'Protect your website from spam and abuse while letting real people pass through with ease.' package: Spam control core: 8.x +core_version_requirement: ^8 || ^9 configure: recaptcha.admin_settings_form dependencies: - captcha:captcha -# Information added by Drupal.org packaging script on 2020-01-29 -version: '8.x-2.5' +# Information added by Drupal.org packaging script on 2020-06-03 +version: '8.x-3.0' project: 'recaptcha' -datestamp: 1580340618 +datestamp: 1591216087 diff --git a/web/modules/recaptcha/recaptcha.module b/web/modules/recaptcha/recaptcha.module index 2b4b2a3759..e49d2488ba 100644 --- a/web/modules/recaptcha/recaptcha.module +++ b/web/modules/recaptcha/recaptcha.module @@ -5,17 +5,11 @@ * Verifies if user is a human without necessity to solve a CAPTCHA. */ -use ReCaptcha\RequestMethod\Drupal8Post; use ReCaptcha\ReCaptcha; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Template\Attribute; use Drupal\Core\Url; - -require_once dirname(__FILE__) . '/recaptcha-php/src/ReCaptcha/ReCaptcha.php'; -require_once dirname(__FILE__) . '/recaptcha-php/src/ReCaptcha/RequestMethod.php'; -require_once dirname(__FILE__) . '/recaptcha-php/src/ReCaptcha/RequestParameters.php'; -require_once dirname(__FILE__) . '/recaptcha-php/src/ReCaptcha/Response.php'; -require_once dirname(__FILE__) . '/src/ReCaptcha/RequestMethod/Drupal8Post.php'; +use Drupal\recaptcha\ReCaptcha\RequestMethod\Drupal8Post; /** * Implements hook_help(). diff --git a/web/modules/recaptcha/src/ReCaptcha/RequestMethod/Drupal8Post.php b/web/modules/recaptcha/src/ReCaptcha/RequestMethod/Drupal8Post.php index 5ff29e1a55..3c74c3cd98 100644 --- a/web/modules/recaptcha/src/ReCaptcha/RequestMethod/Drupal8Post.php +++ b/web/modules/recaptcha/src/ReCaptcha/RequestMethod/Drupal8Post.php @@ -1,6 +1,6 @@ <?php -namespace ReCaptcha\RequestMethod; +namespace Drupal\recaptcha\ReCaptcha\RequestMethod; use ReCaptcha\ReCaptcha; use ReCaptcha\RequestMethod; diff --git a/web/modules/recaptcha/tests/src/Functional/ReCaptchaBasicTest.php b/web/modules/recaptcha/tests/src/Functional/ReCaptchaBasicTest.php index daf01cca38..7ac475f304 100644 --- a/web/modules/recaptcha/tests/src/Functional/ReCaptchaBasicTest.php +++ b/web/modules/recaptcha/tests/src/Functional/ReCaptchaBasicTest.php @@ -39,6 +39,11 @@ class ReCaptchaBasicTest extends BrowserTestBase { */ public static $modules = ['recaptcha', 'captcha']; + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + /** * {@inheritdoc} */ -- GitLab