QueryString constructor for Url.php is invalid
tigohenryschultz opened this issue · comments
Guzzle version(s) affected: x.y.z
PHP version: x.y.z (hint: php --version
) 8.1
cURL version: x.y.z (hint: php -i | grep cURL
)
Description
A websocket class I am using is using a factory which will send ''
Blank string !== QueryString is the bug
How to reproduce
Set 'query' as a blank string
Possible Solution
Add an else condition to set query to null
Additional context
An empty string is not an instance of QueryString so it throws an error
It seems that code in question has already been refactored (removed) from the repo of this library in 2015 (and moved to https://github.com/guzzle/psr7) so this issue is likely outdated.
Versions which contain code in questions (Guzzle 5.x or before) is not supported, so it may be best to migrate to newer version of Guzzle.
Neither Guzzle 5 nor 6 support PHP 8 at all. You need the latest version of Guzzle 7 to run on PHP 8.