mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Fix a PHP 8.1 deprecated use of strlen with a NULL argument
Summary: This call prevents users to view a commit in subversion repositories Indeed, if commiter and/or author field is not properly defined strlen is call with a NULL argument. 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 T15610 Test Plan: - Sign in (if needed) - Open a diffusion SVN repository - Open a commit without user name and or email - You should be able to view the commit Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15610 Differential Revision: https://we.phorge.it/D25400
This commit is contained in:
parent
1b49165ddd
commit
5bd5266461
2 changed files with 3 additions and 3 deletions
|
@ -478,7 +478,7 @@ final class PhabricatorRepositoryCommit
|
|||
}
|
||||
|
||||
$author = $this->getRawAuthorStringForDisplay();
|
||||
if (strlen($author)) {
|
||||
if (phutil_nonempty_string($author)) {
|
||||
return DiffusionView::renderName($author);
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ final class PhabricatorRepositoryCommit
|
|||
}
|
||||
|
||||
$committer = $this->getRawCommitterStringForDisplay();
|
||||
if (strlen($committer)) {
|
||||
if (phutil_nonempty_string($committer)) {
|
||||
return DiffusionView::renderName($committer);
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ final class PhabricatorRepositoryCommitData extends PhabricatorRepositoryDAO {
|
|||
$ref = $this->getCommitRef();
|
||||
|
||||
$committer = $ref->getCommitter();
|
||||
if (strlen($committer)) {
|
||||
if (phutil_nonempty_string($committer)) {
|
||||
return $committer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue