Skip to content

Commit 9e9e70c

Browse files
committed
fix: replace ; with & in salt delimiter for compatibility
1 parent da08c7d commit 9e9e70c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Altcha.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function verifySolution(string|array $data, bool $checkExpires = true): b
154154
*/
155155
private function extractParams(Payload $payload): array
156156
{
157-
$saltParts = explode('?', rtrim($payload->salt, ';'));
157+
$saltParts = explode('?', $payload->salt);
158158
if (\count($saltParts) > 1) {
159159
parse_str($saltParts[1], $params);
160160

src/BaseChallengeOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public function __construct(
3939
}
4040

4141
// Add a delimiter to prevent parameter splicing
42-
if (!str_ends_with($salt, ';')) {
43-
$salt .= ';';
42+
if (!str_ends_with($salt, '&')) {
43+
$salt .= '&';
4444
}
4545

4646
$this->salt = $salt;

0 commit comments

Comments
 (0)