1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 18:22:41 +01:00
phorge-phorge/src/infrastructure
Andre Klapper 19d9da7fea Fix PHP 8.1 "strlen(null)" exception which blocks Working Copy blueprint creation in Drydock
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. So, we adopt an explicit cast to string
in order to answer the question "Is this a non-empty string?" without relying on implicit
cast and deprecated things.

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

Closes T15409

Test Plan:
Applied this change and afterwards, selecting "Working Copy" on `/drydock/blueprint/edit/form/default/` does not show a RuntimeException on strlen() anymore. Instead, it shows a PhutilAggregateException covered in T15408.

Try also creating an integer "Custom Field" in some applications like Maniphest (maniphest.custom-field-definitions)
or in the People component (user.custom-field-definitions) etc., populating the related forms with your usual fuzzy tests.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15409

Differential Revision: https://we.phorge.it/D25235
2023-05-23 11:59:12 +02:00
..
cache Use "@" to silence "GC list" warnings from "apc_store()" and "apcu_store()" 2020-04-28 04:13:37 -07:00
cluster PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
contentsource Fix PHP 8.1 "strlen(null)" exception which blocks creating personal and global Herald rules 2023-05-05 12:53:14 +02:00
customfield Fix PHP 8.1 "strlen(null)" exception which blocks Working Copy blueprint creation in Drydock 2023-05-23 11:59:12 +02:00
daemon Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
diff Fix an issue where we may "min()" an empty array when viewing a revision with no changesets 2022-04-20 13:03:59 -07:00
edges Add a side nav to Conduit API method console pages 2021-07-21 14:16:59 -07:00
editor Restore editor behavior to Diffusion and support "\" shortcut 2020-04-19 09:41:37 -07:00
env PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
events Remove "PhabricatorEventType::TYPE_DIFFUSION_LOOKUPUSER" event 2019-11-19 09:38:03 -08:00
export Remove product literal strings in "pht()", part 9 2022-04-25 12:22:29 -07:00
graph Render user hovercards with context information about their ability to see the context object 2021-02-13 13:37:37 -08:00
internationalization Update "Files" attachment table to show more attachment details and support detachment 2022-05-25 12:56:37 -07:00
javelin Fix is_absolute test in markup 2023-04-28 04:09:55 -07:00
lint/linter Linter fixes 2015-12-03 07:44:23 +11:00
lipsum Continue moving classes with no callers in libphutil or Arcanist to Phabricator 2020-02-12 13:14:04 -08:00
log PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
management Add additional flags to "bin/repository rebuild-identities" to improve flexibility 2019-11-19 09:39:48 -08:00
markup Don't consider file references inside quoted text blocks to grant "attachment intent" 2022-05-23 14:08:15 -07:00
parser Continue moving classes with no callers in libphutil or Arcanist to Phabricator 2020-02-12 13:14:04 -08:00
query Fix PHP 8.1 "strlen(null)" and preg_match() exceptions which block rendering "Browse Subscribers" overlay dialog 2023-05-12 12:02:15 +02:00
ssh Generate a random unique "Request ID" for SSH requests so processes can coordinate better 2018-03-22 13:44:30 -07:00
status Give Drydock Leases more modern status treatment 2018-02-13 13:15:57 -08:00
storage Remove the "Phragment" application 2022-04-25 16:46:27 -07:00
syntax Pass the new default syntax highlighting map to the remarkup engine 2016-05-05 02:51:19 -07:00
testing When running unit tests, ignore any custom task fields 2017-04-02 09:36:17 -07:00
time Render timezone names more readably, with spaces rather than underscores ("America/Los Angeles", not "America/Los_Angeles"). 2019-05-30 15:03:11 -07:00
util Remove product literal strings in "pht()", part 25 2022-04-25 16:46:26 -07:00
PhabricatorEditor.php Mark some strings for translation 2015-06-09 23:06:52 +10:00