1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 00:42:40 +01:00
phorge-arcanist/src
Valerio Bozzolan c14785c379 Fix PHP 8.1 "strpos(null)" exception from PhutilCommandString which blocks arc patch
Summary:
For some reason it may happen that a specific command line argument receives a null argument
from PHP, instead of just an empty string.

Nowadays, this null value probably breaks almost whatever GNU/Linux or FreeBSD or Microsoft Windows
etc. implementations since everyone expect to receive a string.

This used to work in the past since functions like strpos() or strlen() accepted null, but not
anymore. This generate a deprecation warning since PHP 8.1, that is elevated as exception from
Phabricator/Phorge and breaking features.

Without getting into implementation logics (which doesn't make sense to fix all of them) the
calling function should just be kind. So we normalize nonsense null values to an empty string.

Note: this was the expected behavior prior to PHP 8.1.

Now we do that normalization explicitly, in this early point.

After this fix, also T15368 should probably be fixed.

Closes T15367

Test Plan:
- run "arc patch <something valid>"
- to you it must continue to work
- (to @ton it starts working right now)

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: speck, tobiaswiese, Matthew, Cigaryno, ton

Maniphest Tasks: T15367

Differential Revision: https://we.phorge.it/D25205
2023-05-09 08:29:00 +02:00
..
__tests__ Catch more product names in "pht()", and replace newly matched Arcanist product names 2022-04-25 16:45:55 -07:00
browse Add "--browse" to "arc upload" and update behavior, particularly "--json" 2020-05-01 09:13:01 -07:00
channel Move Phage to FuturePool 2020-04-05 05:56:21 -07:00
conduit Remove all product name literals in "pht()" in Arcanist 2022-04-25 12:21:31 -07:00
config Remove all product name literals in "pht()" in Arcanist 2022-04-25 12:21:31 -07:00
configuration Catch more product names in "pht()", and replace newly matched Arcanist product names 2022-04-25 16:45:55 -07:00
console Mostly remove "STDERR" and "STDOUT" constants from Arcanist 2022-05-03 11:58:45 -07:00
difference Fix an initialization issue in VectorTree 2020-05-04 15:50:26 -07:00
differential Catch more product names in "pht()", and replace newly matched Arcanist product names 2022-04-25 16:45:55 -07:00
docs Update Diviner documentation to reference Phorge instead of Phabricator for Arcanist. 2021-06-19 18:46:39 -06:00
engine Implement "arc work", to replace "arc feature" 2020-06-08 16:27:27 -07:00
error Fix PHP 8.1 "strlen(null)" exception in PhutilOpaqueEnvelope.php 2023-04-25 15:40:02 +02:00
events Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
exception Provide some "preg_*" wrappers which raise exceptions on failure 2021-02-19 11:16:09 -08:00
extensions Changes to Arcanist for libphutil "extensions/" 2013-04-22 14:38:49 -07:00
filesystem Mostly remove "STDERR" and "STDOUT" constants from Arcanist 2022-05-03 11:58:45 -07:00
future updating twitch to latest api (Helix) 2022-12-08 15:39:25 -07:00
hardpoint Fix additional "xsprintf()"-family static parameter errors 2020-09-08 11:45:54 -07:00
hgdaemon Fix a property name collision in ArcanistHgServerChannel 2017-02-16 05:44:10 -08:00
init Rebrand: Change Server name 2022-08-25 01:24:41 -07:00
inspector Support inspection of remote refs with "arc inspect remote(...)" 2020-06-30 13:07:25 -07:00
internationalization Add "pht_list()", a translation wrapper for lists of items 2022-05-12 10:57:39 -07:00
ip Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
land Update other usages of "hg rebase" to use the new extension-enabling function 2021-07-21 17:11:25 -04:00
lexer Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
lint Fix early exit from getMatchSeverity on null severity 2023-04-19 17:21:07 +01:00
log Mostly remove "STDERR" and "STDOUT" constants from Arcanist 2022-05-03 11:58:45 -07:00
moduleutils Update "arc liberate" to fix error with PHP 8 and add "--verbose" argument to adjust it 2021-09-04 21:22:23 -04:00
object Correct some Arcanist behaviors under PHP8.1 2021-12-09 13:44:31 -08:00
parser Fix PHP 8.1 "preg_match()" exception when pasting malformed Raw Diff into "Create Diff" 2023-05-04 10:56:23 +02:00
phage Allow "phage" to print execution status on SIGINT 2020-04-06 11:09:43 -07:00
platform Rebrand: Change Server name 2022-08-25 01:24:41 -07:00
progress Mostly remove "STDERR" and "STDOUT" constants from Arcanist 2022-05-03 11:58:45 -07:00
query Provide "gitsprintf(...)" and disambiguate Git ref selectors 2021-01-13 12:31:15 -08:00
readableserializer Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
ref Make corrections to the "arc amend" workflow in Mercurial repositories to be compatible with PHP 5+ 2021-09-16 23:03:06 -04:00
repository Fix a PHP 8.1 issue related to preg_match() and null subject 2023-04-14 22:13:04 +02:00
runtime Catch more product names in "pht()", and replace newly matched Arcanist product names 2022-04-25 16:45:55 -07:00
serviceprofiler Provide additional Arcanist PHP 8.1 fixes 2021-12-09 16:42:19 -08:00
symbols Mostly remove "STDERR" and "STDOUT" constants from Arcanist 2022-05-03 11:58:45 -07:00
toolset Remove all product name literals in "pht()" in Arcanist 2022-04-25 12:21:31 -07:00
unit Catch more product names in "pht()", and replace newly matched Arcanist product names 2022-04-25 16:45:55 -07:00
upload Mostly remove "STDERR" and "STDOUT" constants from Arcanist 2022-05-03 11:58:45 -07:00
utils Fix PHP 8.1 "rawurlencode(null)" exception which blocks rendering a project page 2023-05-04 13:14:24 +02:00
work Update "arc land" display of build failures, and rename "DisplayRef" to "RefView" 2020-06-30 06:27:56 -07:00
workflow Handle ERR-INVALID-AUTH responses from Conduit in patch workflow 2023-05-03 14:48:55 +01:00
workingcopy Introduce "arc inspect" and some of the new ref/hardpoint classes 2020-04-10 05:01:25 -07:00
workingcopyidentity Extend from Phobject 2015-06-15 15:47:33 +10:00
xsprintf Fix PHP 8.1 "strpos(null)" exception from PhutilCommandString which blocks arc patch 2023-05-09 08:29:00 +02:00
__phutil_library_init__.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
__phutil_library_map__.php Add "pht_list()", a translation wrapper for lists of items 2022-05-12 10:57:39 -07:00