1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-13 23:38:34 +01:00
phorge-phorge/src/infrastructure/storage
Andre Klapper 5444e1c885 Fix PHP 8.1 "strlen(null)" exception for "/bin/storage renamespace" 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/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php:62]
```

Test Plan: Run `../phorge/bin/storage renamespace`: Get no `strlen()` error anymore but only expected output `Usage Exception: Specify the dumpfile to read with "--input", or use "--live" to generate one automatically.`

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/D25592
2024-04-17 13:12:40 +02:00
..
__tests__ Update PhabricatorLiskDAO::chunkSQL() for new %Q semantics 2018-11-13 08:59:18 -08:00
connection Remove product literal strings in "pht()", part 6 2022-04-25 12:22:28 -07:00
exception Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00
future Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00
lisk Fix PHP 8.1 "strlen(null)" exceptions creating a Diffusion Identity without entering assignee 2023-06-08 14:52:26 +02:00
management Fix PHP 8.1 "strlen(null)" exception for "/bin/storage renamespace" without parameter 2024-04-17 13:12:40 +02:00
patch Remove Chatlog entirely 2023-11-27 11:38:37 -07:00
schema When storage is partitioned, refuse to serve requests unless web and databases agree on partitioning 2016-11-22 04:15:46 -08:00
xsprintf Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00