1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Fix PHP 8.1 "explode(null)" exception which blocks rendering "Provide Multi-Factor Credentials" page

Summary:
Passing null to the `$string` in `explode(string $separator, string $string, int $limit)` is deprecated since PHP 8.1.
Thus do not explode but create an empty array if the input is null.

Closes T15397

Test Plan: Applied this change and afterwards the "Provide Multi-Factor Credentials" page at `/auth/finish/` showing the "App Code" field correctly rendered in the web browser.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15397

Differential Revision: https://we.phorge.it/D25229
This commit is contained in:
Andre Klapper 2023-05-21 07:56:57 +02:00
parent c1c7699c98
commit 10fae71a04

View file

@ -56,7 +56,7 @@ final class PhabricatorAuthChallenge
AphrontRequest $request) {
assert_instances_of($challenges, __CLASS__);
$token_list = $request->getStr(self::HTTPKEY);
$token_list = $request->getStr(self::HTTPKEY, '');
$token_list = explode(' ', $token_list);
$token_map = array();