summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-29 13:21:49 +0100
committerlsces <lester@lsces.co.uk>2025-08-29 13:21:49 +0100
commit976d6bbd1f9c7b1431688c17eabe954a5d58f621 (patch)
treea9082b2ecfca64b3fed1230cd723ed8c366ffa5d /includes
parent74f9d1ec51bad4f0a86ea51dd51c9ebcc48383d0 (diff)
downloadusers-976d6bbd1f9c7b1431688c17eabe954a5d58f621.tar.gz
users-976d6bbd1f9c7b1431688c17eabe954a5d58f621.tar.bz2
users-976d6bbd1f9c7b1431688c17eabe954a5d58f621.zip
ReCaptcha updated to PHP8.4 and namespace
Diffstat (limited to 'includes')
-rwxr-xr-x[-rw-r--r--]includes/recaptcha/ReCaptcha/ReCaptcha.php2
-rwxr-xr-x[-rw-r--r--]includes/recaptcha/ReCaptcha/Response.php14
2 files changed, 8 insertions, 8 deletions
diff --git a/includes/recaptcha/ReCaptcha/ReCaptcha.php b/includes/recaptcha/ReCaptcha/ReCaptcha.php
index d75ce1f..6984d0a 100644..100755
--- a/includes/recaptcha/ReCaptcha/ReCaptcha.php
+++ b/includes/recaptcha/ReCaptcha/ReCaptcha.php
@@ -169,7 +169,7 @@ class ReCaptcha
$params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION);
$rawResponse = $this->requestMethod->submit($params);
$initialResponse = Response::fromJson($rawResponse);
- $validationErrors = array();
+ $validationErrors = [];
if (isset($this->hostname) && strcasecmp($this->hostname, $initialResponse->getHostname()) !== 0) {
$validationErrors[] = self::E_HOSTNAME_MISMATCH;
diff --git a/includes/recaptcha/ReCaptcha/Response.php b/includes/recaptcha/ReCaptcha/Response.php
index 8a5d3aa..b73d71a 100644..100755
--- a/includes/recaptcha/ReCaptcha/Response.php
+++ b/includes/recaptcha/ReCaptcha/Response.php
@@ -49,7 +49,7 @@ class Response
* Error code strings.
* @var array
*/
- private $errorCodes = array();
+ private $errorCodes = [];
/**
* The hostname of the site where the reCAPTCHA was solved.
@@ -95,14 +95,14 @@ class Response
return new Response(false, array(ReCaptcha::E_INVALID_JSON));
}
- $hostname = isset($responseData['hostname']) ? $responseData['hostname'] : '';
- $challengeTs = isset($responseData['challenge_ts']) ? $responseData['challenge_ts'] : '';
- $apkPackageName = isset($responseData['apk_package_name']) ? $responseData['apk_package_name'] : '';
+ $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'] : '';
+ $action = isset($responseData['action']) ? $responseData['action'] : null;
if (isset($responseData['success']) && $responseData['success'] == true) {
- return new Response(true, array(), $hostname, $challengeTs, $apkPackageName, $score, $action);
+ return new Response(true, [], $hostname, $challengeTs, $apkPackageName, $score, $action);
}
if (isset($responseData['error-codes']) && is_array($responseData['error-codes'])) {
@@ -123,7 +123,7 @@ class Response
* @param string $action
* @param array $errorCodes
*/
- public function __construct($success, array $errorCodes = array(), $hostname = '', $challengeTs = '', $apkPackageName = '', $score = null, $action = '')
+ public function __construct($success, array $errorCodes = [], $hostname = null, $challengeTs = null, $apkPackageName = null, $score = null, $action = null)
{
$this->success = $success;
$this->hostname = $hostname;