Skip to content

Uri::getBaseUrl() should escape @ in password #2201

@Rudloff

Description

@Rudloff

Hello,

Some user decided to use my app behind an Apache basic auth and some of the libraries I use started throwing errors about URLs. Turns out it was because they had a @ in their password.

And inded this code:

$url = new \Slim\Http\Uri('https', 'example.com', 443, '/', '', '', 'foo', 'b@r');
$url->getBaseUrl();

returns https://foo:b@[email protected].

But according the URL standard, the user and password should be percent-encoded: https://foo:b%[email protected].

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions