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

Straggling fixes for PhutilURI under PHP 8.1

Summary: Ref T13588. Additional PhutilURI fixes for PHP 8.1.

Test Plan: Ran "arc unit --everything" in Phabricator.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21822
This commit is contained in:
epriestley 2022-05-12 15:37:33 -07:00
parent 3cc486d5c1
commit 942b54a697

View file

@ -194,7 +194,7 @@ final class PhutilURI extends Phobject {
$query = null;
}
if (strlen($this->getFragment())) {
if (phutil_nonempty_string($this->getFragment())) {
$fragment = '#'.$this->getFragment();
} else {
$fragment = null;
@ -433,7 +433,7 @@ final class PhutilURI extends Phobject {
if ($this->isGitURI()) {
// Git URIs use relative paths which do not need to begin with "/".
} else {
if ($this->domain && strlen($path) && $path[0] !== '/') {
if ($this->domain && phutil_nonempty_string($path) && $path[0] !== '/') {
$path = '/'.$path;
}
}