@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: Search: Do not pass a null function key to results array

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/search/compiler/PhutilSearchQueryCompiler.php:469]
```

Closes T16401

Test Plan: Go to http://phorge.localhost/search/query/advanced/; enter "foo" in the "Query" field

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

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

Maniphest Tasks: T16401

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

+3
+3
src/applications/search/compiler/PhutilSearchQueryCompiler.php
··· 461 461 $present_tokens = array(); 462 462 $absent_tokens = array(); 463 463 foreach ($results as $result) { 464 + if (!isset($result['function'])) { 465 + continue; 466 + } 464 467 $function = $result['function']; 465 468 466 469 if ($result['operator'] === self::OPERATOR_ABSENT) {