From 10fae71a042f07d8901afd5dc2d737317f27a126 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sun, 21 May 2023 07:56:57 +0200 Subject: [PATCH] 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 --- src/applications/auth/storage/PhabricatorAuthChallenge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/auth/storage/PhabricatorAuthChallenge.php b/src/applications/auth/storage/PhabricatorAuthChallenge.php index 0b740e5fa7..05d00c3e6e 100644 --- a/src/applications/auth/storage/PhabricatorAuthChallenge.php +++ b/src/applications/auth/storage/PhabricatorAuthChallenge.php @@ -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();