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

Fix strlen(null) in DifferentialChangesetViewController loadCoverage()

Summary:
DifferentialChangesetViewController loadCoverage() fails under PHP 8.1 when test coverage is provided for some but not all modified files.

Update the code to replace strlen() with phutil_nonempty_string().

Fixes T15521

Test Plan: View a diff with test coverage for some but not all files.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15521

Differential Revision: https://we.phorge.it/D25328
This commit is contained in:
Steve Campbell 2023-07-04 15:16:13 +01:00
parent f7dd8f579a
commit 8cbbc9f961

View file

@ -451,11 +451,10 @@ final class DifferentialChangesetViewController extends DifferentialController {
continue; continue;
} }
$coverage_data = idx($test_coverage, $changeset->getFileName()); $coverage_data = idx($test_coverage, $changeset->getFileName());
if (!strlen($coverage_data)) { if (phutil_nonempty_string($coverage_data)) {
continue;
}
$coverage[] = $coverage_data; $coverage[] = $coverage_data;
} }
}
if (!$coverage) { if (!$coverage) {
return null; return null;