Repository navigation
Description
-
In https://github.com/bigbluebutton/bigbluebutton-api-php/blob/master/src/Parameters/BaseParameters.php#L69
we can find a str_replace that is applied to the result of http_build_query. When http_build_query is called with PHP_QUERY_RFC3986 nearly all of the str_replace replacements are already done. -
The same function also replaces %20 with +. RFC3986 used %20 for whitespace not +. The official example also use %20 and not +. (Example search for %20 on https://docs.bigbluebutton.org/development/api/)
-
If buildUrl is called without params it produces and output like "https://bigbluebutton.tld/bigbluebutton/api?&checksum=123" instead of
"https://bigbluebutton.tld/bigbluebutton/api?checksum=123"
Inside buildQs we should check if params is empty and only then add "&"
/**
* Builds an API method URL that includes the url + params + its generated checksum.
*/
public function buildUrl(string $method = '', string $params = '', bool $append = true): string
{
return $this->baseUrl . 'api/' . $method . ($append ? '?' . $this->buildQs($method, $params) : '');
}
/**
* Builds a query string for an API method URL that includes the params + its generated checksum.
*
* @deprecated Function only used internal. Function will be private soon. No replacement.
*/
public function buildQs(string $method = '', string $params = ''): string
{
return $params . '&checksum=' . hash($this->hashingAlgorithm->value, $method . $params . $this->secret);
}
Activity