Page MenuHomePhorge

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

Authored by aklapper on May 13 2023, 13:48.
Tags
None
Referenced Files
F3293926: D25229.1742926406.diff
Mon, Mar 24, 18:13
F3290405: D25229.1742864739.diff
Mon, Mar 24, 01:05
F3224961: D25229.1742089902.diff
Sat, Mar 15, 01:51
F3221059: D25229.1741813553.diff
Tue, Mar 11, 21:05
F3221058: D25229.1741813549.diff
Tue, Mar 11, 21:05
F3221057: D25229.1741813546.diff
Tue, Mar 11, 21:05
F3220313: D25229.1741808861.diff
Tue, Mar 11, 19:47
F3053254: D25229.1740988263.diff
Sun, Mar 2, 07:51

Details

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.

Diff Detail

Repository
rP Phorge
Branch
arcpatch-D25229_2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 431
Build 431: arc lint + arc unit

Event Timeline

Thanks - small tip here

src/applications/auth/storage/PhabricatorAuthChallenge.php
59

Also here probably the minimal change is just the above one

Thanks again for this patch

I talked with the kind user aklapper about the proposed minimal change and, hoping to be useful, I will amend that small thing

I tested this locally and this works

This revision is now accepted and ready to land.May 20 2023, 20:27

amend a small thing we discussed in live

valerio.bozzolan edited the summary of this revision. (Show Details)