@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

PHP 8.5: Files: Do not check for an empty engine key as array key

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/files/document/render/PhabricatorDocumentRenderingEngine.php:52]
```

Closes T16416

Test Plan: On PHP 8.5, go to a File page in the File application.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16416

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

+1 -1
+1 -1
src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
··· 49 49 $engines = PhabricatorDocumentEngine::getEnginesForRef($viewer, $ref); 50 50 51 51 $engine_key = $this->getSelectedDocumentEngineKey(); 52 - if (!isset($engines[$engine_key])) { 52 + if ($engine_key === null || !isset($engines[$engine_key])) { 53 53 $engine_key = head_key($engines); 54 54 } 55 55 $engine = $engines[$engine_key];