Skip to content

Commit ba80a1f

Browse files
committed
Support user:pass params in buildUrl
Might as well support the full URL specification while we are fixing things. With reference to unparse_url found at http://php.net/manual/en/function.parse-url.php#106731
1 parent c4156ec commit ba80a1f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Url.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ protected function buildUrl()
415415
$url .= $this->info['scheme'].'://';
416416
}
417417

418+
$user = isset($this->info['user']) ? $this->info['user'] : '';
419+
$pass = isset($this->info['pass']) ? ':' . $this->info['pass'] : '';
420+
if ($user || $pass) {
421+
$url .= $user . $pass . '@';
422+
}
423+
418424
if (isset($this->info['host'])) {
419425
$url .= $this->info['host'];
420426
}

0 commit comments

Comments
 (0)