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

Fix PHP 8.1 "strlen(null)" exception when using transaction.search

Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

This is not visible in the web user interface, only in the PHP error log.

```
strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [TransactionSearchConduitAPIMethod.php:273]
```

Test Plan: * Call Conduit method `transaction.search` with a differential objectIdentifier (e.g. D1)

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

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

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

+1 -1
+1 -1
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
··· 270 270 } 271 271 272 272 $group_id = $xaction->getTransactionGroupID(); 273 - if (!strlen($group_id)) { 273 + if (!phutil_nonempty_string($group_id)) { 274 274 $group_id = null; 275 275 } else { 276 276 $group_id = (string)$group_id;