1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 22:32:41 +01:00

Fix more PHP 8.1 "strlen(null)" callsites in PhutilURI

Summary: Ref T13676. Ref T13588. These properties on PhutilURI have flexible types, just wrap them.

Test Plan: Built a new Drydock working copy with an HTTPS URI under PHP 8.1, see T13676.

Maniphest Tasks: T13676, T13588

Differential Revision: https://secure.phabricator.com/D21798
This commit is contained in:
epriestley 2022-05-03 11:57:26 -07:00
parent 8d487ed770
commit e5b92735c6

View file

@ -154,9 +154,9 @@ final class PhutilURI extends Phobject {
$user = $this->user;
$pass = $this->pass;
if (strlen($user) && strlen($pass)) {
if (phutil_nonempty_string($user) && phutil_nonempty_string($pass)) {
$auth = rawurlencode($user).':'.rawurlencode($pass).'@';
} else if (strlen($user)) {
} else if (phutil_nonempty_string($user)) {
$auth = rawurlencode($user).'@';
} else {
$auth = null;