1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-18 18:51:12 +01:00
phorge-phorge/src/applications/herald
Andre Klapper 0e53f91c97 Fix PHP 8.1 "strlen(null)" exception for "/bin/herald test" 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 another similar strlen() occurrence 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/herald/management/HeraldTestManagementWorkflow.php:33]
```

Test Plan: Run `../phorge/bin/herald test`: Get no `strlen()` error anymore but only expected output `Usage Exception: Specify an object to test rules for with "--object".`

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/D25586
2024-04-17 13:08:05 +02:00
..
action Don't present users with Herald fields/actions for uninstalled applications, unless the rule already uses them 2019-09-12 14:33:28 -07:00
adapter Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
application Show more in Application Detail and List view 2023-11-21 11:22:23 -07:00
capability Add skeleton code for webhooks 2018-02-09 13:55:04 -08:00
config Remove "HeraldRepetitionPolicyConfig" and hide storage details inside HeraldRule 2018-01-26 11:03:29 -08:00
contentsource Modularize content sources 2016-03-26 11:59:45 -07:00
controller Work around exception in Herald transcript of old tasks: Call to a member function getAppliedTransactionPHIDs() on bool 2023-06-12 21:49:14 +02:00
edge On Harbormaster build plans, show which Herald rules trigger builds 2019-03-07 13:51:40 -08:00
editor Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
engine Provide a more structured result log for Herald rules 2021-02-19 11:16:22 -08:00
engineextension Index Herald fields, not just actions, when identifying objects related to a particular Herald rule 2019-09-09 12:50:43 -07:00
field Add a "Comment content" field to Herald 2020-10-16 13:42:56 -07:00
garbagecollector Refine core webhook implementation somewhat 2018-02-09 13:55:55 -08:00
group Make Herald action modularization more aggressive 2015-08-03 14:33:20 -07:00
mail Support Herald rules for Herald rules 2018-04-25 06:47:19 -07:00
management Fix PHP 8.1 "strlen(null)" exception for "/bin/herald test" without parameter 2024-04-17 13:08:05 +02:00
phid Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
query Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
remarkup Rename PhutilRemarkupRule subclasses 2014-08-05 00:55:43 +10:00
state Prepare TransactionEditor for silent transactions via bulk edit 2018-01-19 13:23:38 -08:00
storage Fix a PHP 8.1 unit test failure in Projects 2022-04-01 12:52:57 -07:00
typeahead Make misc get*ApplicationClass[Name]() calls return ::class constant instead of string 2024-02-05 14:11:36 +01:00
value In Herald transcripts, render some field values in a more readable way 2020-01-29 15:14:06 -08:00
view On Harbormaster build plans, show which Herald rules trigger builds 2019-03-07 13:51:40 -08:00
worker In Webhooks, give errors human-readable labels and show reminder text for "Silent Mode" 2018-12-28 00:05:46 -08:00
xaction Modularize PhabricatorEditEngineConfigurationTransaction 2019-06-20 16:25:21 -07:00