Skip to content

Commit

Permalink
Merge e03b42a into bc6f29e
Browse files Browse the repository at this point in the history
  • Loading branch information
nbayramberdiyev committed Mar 4, 2022
2 parents bc6f29e + e03b42a commit 50c3f3d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/Factory/UriFactory.php
Expand Up @@ -94,10 +94,7 @@ public function createFromGlobals(array $globals): Uri
}

// Query string
$queryString = '';
if (isset($globals['QUERY_STRING'])) {
$queryString = $globals['QUERY_STRING'];
}
$queryString = $globals['QUERY_STRING'] ?? '';

// Request URI
$requestUri = '';
Expand Down
4 changes: 2 additions & 2 deletions src/Uri.php
Expand Up @@ -87,8 +87,8 @@ public function __construct(
$this->path = $this->filterPath($path);
$this->query = $this->filterQuery($query);
$this->fragment = $this->filterFragment($fragment);
$this->user = $user;
$this->password = $password;
$this->user = $this->filterUserInfo($user);
$this->password = $this->filterUserInfo($password);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Factory/UriFactoryTest.php
Expand Up @@ -53,7 +53,7 @@ public function testGetUserInfoWithUsernameAndPasswordEncodesCorrectly()
{
$uri = $this
->createUriFactory()
->createUri('https://bob%40example.com:pass%3Aword@example.com:443/foo/bar?abc=123#section3');
->createUri('https://bob@example.com:pass:word@example.com:443/foo/bar?abc=123#section3');

$this->assertEquals('bob%40example.com:pass%3Aword', $uri->getUserInfo());
}
Expand Down

0 comments on commit 50c3f3d

Please sign in to comment.