1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-08 16:02:39 +01:00
phorge-arcanist/src
Andre Klapper 788098096e Fix PHP 8.0 ValueError calling mb_convert_encoding() with an invalid encoding
Summary:
Per https://www.php.net/manual/en/function.mb-convert-encoding.php, as of PHP 8.0.0, a ValueError is thrown if the value of `to_encoding` or `from_encoding` is an invalid encoding but a ValueError is not suppressed by the stfu operator ("@").

Origin of the function:

https://secure.phabricator.com/rPHU72ad8fd0f05b0d84f7d8efd7db62ad0b3ba4431f

Premising that Arcanist elevates warnings to exception, now we just try-catch.

Closes T15423

Test Plan:
On `/diffusion/edit/1/page/encoding/`,
* enter a valid encoding, such as "7bit", successfully changed encoding
* enter a valid encoding with random capitalization, such as "7biT", successfully changed encoding
* enter a valid alias encoding, such as "ISO-10646-UCS-2", successfully changed encoding
* enter a valid alias encoding with random capitalization, such as "isO-10646-uCS-2", successfully changed encoding
* enter an invalid encoding, such as "whatever", get error message "Repository encoding "whatever" is not valid: String conversion from encoding 'UTF-8' to encoding 'whatever' failed: mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "whatever" given"
In any case, no exception is shown anymore.

Reviewers: O1 Blessed Committers, valerio.bozzolan, speck

Reviewed By: O1 Blessed Committers, valerio.bozzolan, speck

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

Maniphest Tasks: T15423

Differential Revision: https://we.phorge.it/D25249
2023-07-29 12:20:40 +03:00
..
__tests__ Catch more product names in "pht()", and replace newly matched Arcanist product names 2022-04-25 16:45:55 -07:00
browse Improve arc-browse for php 8.1 2023-07-07 09:16:59 -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 Correct spelling mistake in PhutilLock 2023-05-29 10:29:05 +02: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 (arc) Unify type-checking for setHref() type methods 2023-07-24 12:33:47 -07: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 Improve arc-browse for php 8.1 2023-07-07 09:16:59 -07: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 Fix tab complete in php 8 2023-07-21 09:45:55 -07:00
unit Fix strlen() being passed a null in ArcanistUnitConsoleRenderer.php 2023-06-19 14:55:49 +01:00
upload Mostly remove "STDERR" and "STDOUT" constants from Arcanist 2022-05-03 11:58:45 -07:00
utils Fix PHP 8.0 ValueError calling mb_convert_encoding() with an invalid encoding 2023-07-29 12:20:40 +03:00
work Update "arc land" display of build failures, and rename "DisplayRef" to "RefView" 2020-06-30 06:27:56 -07:00
workflow Correct a PHP8 compatibility issue when running "arc diff" with no active branch 2023-05-24 20:06:26 +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