Skip to content

Commit 8876f75

Browse files
committed
Fix a PHP 8.1 deprecated use of strlen with a NULL argument
Summary: This call is preventing users to browse Subversion repositories. Using strlen() to check string validity is deprecated since PHP 8.1, phorge adopts phutil_nonempty_string() as a replacement. Note: this may highlight other absurd input values that might be worth correcting instead of just ignoring. If phutil_nonempty_string() throws an exception in your instance, report it to Phorge to evaluate and fix that specific corner case. Fix T15608 Test Plan: - Sign in - Open a Diffusion SVN repository - You should see the repository instead of getting a Runtime Exception Reviewers: O1 Blessed Committers, Sten, avivey Reviewed By: O1 Blessed Committers, Sten, avivey Subscribers: Sten, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15608 Differential Revision: https://we.phorge.it/D25398
1 parent 6ec89e9 commit 8876f75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/applications/diffusion/controller/DiffusionRepositoryController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ private function buildBrowseTable(
508508

509509
$repository_name = $repository->getName();
510510
$branch_name = $drequest->getBranch();
511-
if (strlen($branch_name)) {
511+
if (phutil_nonempty_string($branch_name)) {
512512
$repository_name .= ' ('.$branch_name.')';
513513
}
514514

0 commit comments

Comments
 (0)