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
F3317363: D25229.1743260662.diff
Fri, Mar 28, 15:04
F3317027: D25229.1743258984.diff
Fri, Mar 28, 14:36
F3316154: D25229.1743248398.diff
Fri, Mar 28, 11:39
F3313702: D25229.1743221663.diff
Fri, Mar 28, 04:14
F3309783: D25229.1743187669.diff
Thu, Mar 27, 18:47
F3308723: D25229.1743175189.diff
Thu, Mar 27, 15:19
F3306693: D25229.1743130659.diff
Thu, Mar 27, 02:57
F3304822: D25229.1743106355.diff
Wed, Mar 26, 20:12

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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)