Skip to content

Commit

Permalink
Fix http_build_query in OTP class (#215)
Browse files Browse the repository at this point in the history
The change fixes a syntax issue with http_build_query in OTP class. Specifically, incorrect usage of 'arg_separator' as a keyword argument results in an error. Replaced that incorrect usage with the appropriate way of using this function, improving the reliability and correctness of building the query string.
  • Loading branch information
Spomky authored Apr 15, 2024
1 parent 23c9076 commit b737d1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected function generateURI(string $type, array $options): string
$this->hasColon($label) === false || throw new InvalidArgumentException('Label must not contain a colon.');
$options = [...$options, ...$this->getParameters()];
$this->filterOptions($options);
$params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options, arg_separator: '&'));
$params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options, '', '&'));

return sprintf(
'otpauth://%s/%s?%s',
Expand Down

0 comments on commit b737d1c

Please sign in to comment.