1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-08 13:51:02 +01:00
phorge-phorge/src/applications/conduit
Andre Klapper 1c098c273d Fix PHP 8.1 "strlen(null)" exception calling Conduit's user.whoami
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.

```
EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=97e163187418), phorge(head=master, ref.master=7bbd657c19c4)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:686]
```

Closes T15469

Test Plan: After applying this change, `/api/user.whoami` correctly renders the "Method Call Result"

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15469

Differential Revision: https://we.phorge.it/D25292
2023-06-13 07:31:52 +02:00
..
application Allow Conduit method call logs to be exported with the standard export pipeline 2019-01-18 20:09:57 -08:00
call Conduit accept int/bool parameters as strings 2016-10-14 14:45:57 +00:00
controller Fix PHP 8.1 "strlen(null)" exception calling Conduit's user.whoami 2023-06-13 07:31:52 +02:00
data Add a side nav to Conduit API method console pages 2021-07-21 14:16:59 -07:00
garbagecollector Remove all references to the Conduit ConnectionLog 2015-12-14 15:25:11 -08:00
interface Formalize custom Conduit fields on objects 2015-12-14 11:54:13 -08:00
management Provide a "--local" flag to "bin/conduit call" to force in-process execution 2020-04-14 13:24:26 -07:00
method Remove product literal strings in "pht()", part 14 2022-04-25 16:46:24 -07:00
parametertype Make Conduit "www-form-urlencoded" parsing of "true" and "false" case-insensitive 2020-04-27 13:28:47 -07:00
protocol Lift Diffusion Conduit call proxying to the root level of Conduit 2020-09-15 17:36:37 -07:00
query Fix PHP 8.1 "strlen(null)" exceptions which block rendering the Conduit page 2023-04-30 18:28:13 +02:00
settings Add icons to Settings 2019-01-23 13:41:41 -08:00
ssh Use phutil_microseconds_since(...) to simplify some timing arithmetic 2018-11-08 16:46:32 -08:00
storage Use futures to improve clustered repository main page performance 2016-12-08 07:26:32 -08:00