1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-28 17:52:42 +01:00

Fix PHP 8.1 exception in Conduit: Make "array_fuse(array $list)" accept null as parameter

Summary:
`array_fuse` in Arcanist is a wrapper for calling `array_combine($list, $list)`.
The latter doesn't accept passing `null` in PHP 8.2.
Going to `/conduit/method/project.create/`, entering a `name` but nothing as `members` (so we pass `null`), and calling this method, an exception is thrown.

Thus make `array_fuse` accept null and return an empty list in such cases.

Closes T15393

Test Plan: Applied this change; afterwards "Method Call Result" page at `/api/project.create`  correctly displayed in the web browser.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15393

Differential Revision: https://we.phorge.it/D25228
This commit is contained in:
Andre Klapper 2023-05-21 00:06:42 +02:00
parent 5cdafa4002
commit e4fd31ec02

View file

@ -954,7 +954,7 @@ function phutil_split_lines($corpus, $retain_endings = true) {
* @param list List of scalars. * @param list List of scalars.
* @return dict Dictionary with inputs mapped to themselves. * @return dict Dictionary with inputs mapped to themselves.
*/ */
function array_fuse(array $list) { function array_fuse(array $list = null) {
if ($list) { if ($list) {
return array_combine($list, $list); return array_combine($list, $list);
} }