mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Fix PhabricatorRepository generateURI PHP 8.1 strlen(null) errors
Summary: When viewing a repository in Diffusion, clicking on a folder (eg https://my.phorge.site/source/myrepo/browse/master/myfolder/) will generate multiple strlen(null) exceptions under PHP 8.1 Fix is to replace all the strlen() calls with phutil_nonempty_string() Fixes T15532 Test Plan: View a folder in a repo in Diffusion. Eg https://my.phorge.site/source/myrepo/browse/master/myfolder/ Reviewers: O1 Blessed Committers, avivey Reviewed By: O1 Blessed Committers, avivey Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15532 Differential Revision: https://we.phorge.it/D25336
This commit is contained in:
parent
8af1624692
commit
849e18ccbb
1 changed files with 4 additions and 4 deletions
|
@ -779,15 +779,15 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
||||||
break;
|
break;
|
||||||
case 'compare':
|
case 'compare':
|
||||||
$uri = $this->getPathURI("/{$action}/");
|
$uri = $this->getPathURI("/{$action}/");
|
||||||
if (strlen($head)) {
|
if (phutil_nonempty_scalar($head)) {
|
||||||
$query['head'] = $head;
|
$query['head'] = $head;
|
||||||
} else if (strlen($raw_commit)) {
|
} else if (phutil_nonempty_scalar($raw_commit)) {
|
||||||
$query['commit'] = $raw_commit;
|
$query['commit'] = $raw_commit;
|
||||||
} else if (strlen($raw_branch)) {
|
} else if (phutil_nonempty_scalar($raw_branch)) {
|
||||||
$query['head'] = $raw_branch;
|
$query['head'] = $raw_branch;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($against)) {
|
if (phutil_nonempty_scalar($against)) {
|
||||||
$query['against'] = $against;
|
$query['against'] = $against;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue