@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.

PHP 8.5: Fix null array key checking project membership when anonymous

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 the key parameter for array_key_exists() is deprecated, use an empty string instead at [/var/www/html/phorge/phorge/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:287]
```

Closes T16377

Test Plan:
* PHP 8.5
* Set `/config/edit/policy.allow-public` to `true`
* Create a Maniphest task with View Policy = Public
* Access that task while not logged in
* Get two errors less

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

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

Maniphest Tasks: T16377

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

+2 -1
+2 -1
src/applications/project/storage/PhabricatorProject.php
··· 144 144 145 145 switch ($capability) { 146 146 case PhabricatorPolicyCapability::CAN_VIEW: 147 - if ($this->isUserMember($viewer->getPHID())) { 147 + $viewer_phid = $viewer->getPHID(); 148 + if ($viewer_phid && $this->isUserMember($viewer_phid)) { 148 149 // Project members can always view a project. 149 150 return true; 150 151 }