From b737d1c6330beae7c0bc225d3e848805b352fe42 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Mon, 15 Apr 2024 09:35:15 +0200 Subject: [PATCH] Fix http_build_query in OTP class (#215) 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. --- src/OTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OTP.php b/src/OTP.php index e042917..944ed8f 100644 --- a/src/OTP.php +++ b/src/OTP.php @@ -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',