1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-31 08:58:20 +01:00
phorge-phorge/src/applications/almanac
Andre Klapper 5fe2fc33fb Fix PHP 8.1 "strlen(null)" exception for "/bin/almanac register" without parameter
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 patch also fixes two similar strlen() occurrences in the same source file.

```
ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/almanac/management/AlmanacManagementRegisterWorkflow.php:41]
```

Test Plan: Run `../phorge/bin/almanac register`: Get no `strlen()` error anymore but only expected output `Usage Exception: Specify a device with --device.`

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25591
2024-04-17 13:12:16 +02:00
..
application Clean up some old cluster-ish documentation 2016-04-12 19:14:08 -07:00
capability Simplify locking of Almanac cluster services 2016-02-25 03:38:39 -08:00
conduit Provide "almanac.binding.search" and "almanac.binding.edit" 2018-04-11 10:37:38 -07:00
constants Make upstream callers respect "active bindings" when querying Almanac 2021-03-16 15:51:47 -07:00
controller Add a "status" property to Almanac devices 2021-03-16 15:51:47 -07:00
editor Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
engineextension Correct issue with "bindings" conduit attachment 2021-03-27 09:26:24 -07:00
management Fix PHP 8.1 "strlen(null)" exception for "/bin/almanac register" without parameter 2024-04-17 13:12:16 +02:00
phid Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
property Modularize Almanac property transactions 2018-04-11 10:33:18 -07:00
query Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
servicetype Remove product literal strings in "pht()", part 1 2022-04-25 12:22:25 -07:00
storage Modernize "mailKey" for Almanac Networks 2021-03-16 15:51:49 -07:00
typeahead Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
util Remove some "Phacility" and "epriestley" references 2021-07-08 10:46:17 -07:00
view Make upstream callers respect "active bindings" when querying Almanac 2021-03-16 15:51:47 -07:00
xaction Add a "status" property to Almanac devices 2021-03-16 15:51:47 -07:00