From 17247f56be0ecbbc890060e25b0bd029a29a3ebc Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 18 Dec 2025 13:38:25 +0100 Subject: [PATCH] PHP 8.5: Repository creation: Gracefully handle missing VCS parameter Summary: Setting null as an array key is deprecated since PHP 8.5 per https://www.php.net/releases/8.5/en.php: "Using null as an array offset or when calling array_key_exists() is now deprecated. Use an empty string instead." ``` ERROR 8192: Using null as an array offset is deprecated, use an empty string instead at [/var/www/html/phorge/phorge/src/applications/diffusion/controller/DiffusionRepositoryEditController.php:17] ``` Closes T16406 Test Plan: Go to http://phorge.localhost/diffusion/edit/form/default/ on PHP 8.5 Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16406 Differential Revision: https://we.phorge.it/D26603 --- .../diffusion/controller/DiffusionRepositoryEditController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditController.php index af05f6719f..04946cdcdd 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditController.php @@ -14,7 +14,7 @@ final class DiffusionRepositoryEditController $vcs = $request->getStr('vcs'); $vcs_types = PhabricatorRepositoryType::getRepositoryTypeMap(); - if (empty($vcs_types[$vcs])) { + if (!$vcs || empty($vcs_types[$vcs])) { return $this->buildVCSTypeResponse(); } -- 2.51.2