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

Fix strlen(null) PHP 8.1 error when pushing into a fresh repository

Summary:
Doing a git push into a fresh repository over https fails with a PHP 8.1 strlen(null) error.

This fixes it.

Fixes T15569

Test Plan:
* Create an empty repository on a PHP 8.1 Phorge instance
* Clone it
* Add some data
* git push

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15569

Differential Revision: https://we.phorge.it/D25361
This commit is contained in:
c7574226 2023-07-28 18:22:42 +01:00 committed by sten
parent 1aa532a476
commit 189a5d6047

View file

@ -1133,7 +1133,7 @@ final class DiffusionCommitHookEngine extends Phobject {
->setHookWait(phutil_microseconds_since($hook_start));
$identifier = $this->getRequestIdentifier();
if (strlen($identifier)) {
if ($identifier !== null && strlen($identifier)) {
$event->setRequestIdentifier($identifier);
}