-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uri::__toString()
can yield malformed URIs
#172
Comments
Uri::__toString()
can yield malformed URIs
PHP's function array(3) {
'scheme' =>
string(4) "http"
'host' =>
string(16) "invalid:%20https"
'path' =>
string(13) "//example.com"
} Lines 80 to 87 in 4c6ae00
Lines 384 to 392 in 4c6ae00
|
Thanks, @TimWolla for cross posting. Lets see how guzzle will handle this, after my latest hassle with |
I introduce basic host validation with the linked PR but anything more comprehensive would need to be done via integration tests. The changes I introduced need to be elevated to the integration tests as well to ensure it is handled across all implementations. |
Bug Report
Summary
The
Uri
class is able to parse malformed URIs but this results inUri::__toString()
generating a malformed URI. Attempting to pass that URI back into Uri will yield aInvalidArgumentException
.Current behavior
Certain malformed URIs do not round-trip through
\Laminas\Diactoros\Uri
.How to reproduce
Expected behavior
Either both constructors throw, or neither.
Note: This issue also exists in guzzlehttp/psr7 and was reported at guzzle/psr7#583.
The text was updated successfully, but these errors were encountered: