Skip to content

Commit 6b4b245

Browse files
committed
Fixed #20399: Setting userinfo to FALSE not transparent
Setting userinfo to FALSE in Net_URL2::setUserinfo() was not consistent with getting it later on via Net_URL2::getUserinfo() as it was silently converted to a zero-length string. This has been fixed by not converting FALSE to string.
1 parent 313b2ab commit 6b4b245

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Net/URL2.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,12 @@ public function setUserinfo($userinfo, $password = false)
271271
if ($password !== false) {
272272
$userinfo .= ':' . $password;
273273
}
274-
$this->_userinfo = $this->_encodeData($userinfo);
274+
275+
if ($userinfo !== false) {
276+
$userinfo = $this->_encodeData($userinfo);
277+
}
278+
279+
$this->_userinfo = $userinfo;
275280
return $this;
276281
}
277282

0 commit comments

Comments
 (0)