@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Fix PHP 8.5 null array key creating an Almanac Service

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/almanac/controller/AlmanacServiceEditController.php:19]
```

Closes T16433

Test Plan: On PHP 8.5, go to http://phorge.localhost/almanac/service/edit/form/default/

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16433

Differential Revision: https://we.phorge.it/D26653

+1 -1
+1 -1
src/applications/almanac/controller/AlmanacServiceEditController.php
··· 16 16 17 17 $service_type = $request->getStr('serviceType'); 18 18 $service_types = AlmanacServiceType::getAllServiceTypes(); 19 - if (empty($service_types[$service_type])) { 19 + if ($service_type === null || empty($service_types[$service_type])) { 20 20 return $this->buildServiceTypeResponse($list_uri); 21 21 } 22 22