@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Conduit: Validate that "attachments" parameter is an array

Summary:
Do the same dance as for "constraints" a few lines earlier.

```
EXCEPTION: (RuntimeException) array_keys() expects parameter 1 to be array, string given at [<arcanist>/src/error/PhutilErrorHandler.php:270]
#1 <#2> array_keys(string) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1280]
```

Closes T16395

Test Plan: Unknown.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

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

Maniphest Tasks: T16395

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

+7 -1
+7 -1
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 1283 1283 1284 1284 $attachments = $this->getConduitSearchAttachments(); 1285 1285 1286 - // TODO: Validate this better. 1287 1286 $attachment_specs = $request->getValue('attachments', array()); 1287 + if (!is_array($attachment_specs)) { 1288 + throw new Exception( 1289 + pht( 1290 + 'Parameter "attachments" must be a map of attachments, got "%s".', 1291 + phutil_describe_type($attachment_specs))); 1292 + } 1293 + 1288 1294 $attachments = array_select_keys( 1289 1295 $attachments, 1290 1296 array_keys($attachment_specs));