Skip to content

Commit

Permalink
explixitly set arg_separator for generateURI
Browse files Browse the repository at this point in the history
We cannot rely on arg_separator.output to be set to it's default '&', therefore we explicitly set it here.

Signed-off-by: Daniel Ziegenberg <[email protected]>
  • Loading branch information
ziegenberg committed Apr 14, 2024
1 parent 3380f38 commit b73e581
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 @@ -98,7 +98,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));
$params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options, arg_separator: '&'));

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

0 comments on commit b73e581

Please sign in to comment.