From 189a5d60478e097ef4f65c8bcf1704bfd8e5b774 Mon Sep 17 00:00:00 2001 From: c7574226 Date: Fri, 28 Jul 2023 18:22:42 +0100 Subject: [PATCH] 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 --- src/applications/diffusion/engine/DiffusionCommitHookEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php index c172f27466..e4e8fd2293 100644 --- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php +++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php @@ -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); }