From 79c4be472d3d53f7bf3117899b7082f17ee3c6dc Mon Sep 17 00:00:00 2001 From: JensFalk Date: Mon, 21 Sep 2026 18:08:34 +0200 Subject: [PATCH] Fehlende ALTCHA-Bibliotheksdateien ergaenzt --- .../Altcha/V1/BaseChallengeOptions.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 fp_altcha_spamschutz/src/Vendor/AltchaOrg/Altcha/V1/BaseChallengeOptions.php diff --git a/fp_altcha_spamschutz/src/Vendor/AltchaOrg/Altcha/V1/BaseChallengeOptions.php b/fp_altcha_spamschutz/src/Vendor/AltchaOrg/Altcha/V1/BaseChallengeOptions.php new file mode 100644 index 0000000..6dc9bae --- /dev/null +++ b/fp_altcha_spamschutz/src/Vendor/AltchaOrg/Altcha/V1/BaseChallengeOptions.php @@ -0,0 +1,46 @@ + + */ +class BaseChallengeOptions +{ + public const DEFAULT_MAX_NUMBER = 1000000; + + public readonly string $salt; + + /** + * Options for creation of a new challenge. + * + * @see ChallengeOptions for options with sane defaults. + * + * @param ChallengeParams $params + */ + public function __construct( + public readonly Algorithm $algorithm, + public readonly int $maxNumber, + public readonly ?\DateTimeInterface $expires, + string $salt, + public readonly int $number, + public readonly array $params, + ) { + if ($expires) { + $params['expires'] = $expires->getTimestamp(); + } + + if (!empty($params)) { + $salt .= '?' . http_build_query($params); + } + + // Add a delimiter to prevent parameter splicing + if (!str_ends_with($salt, '&')) { + $salt .= '&'; + } + + $this->salt = $salt; + } +}