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 substr(null) in People > Activity Logs

Summary:
When someone tries to log on with invalid credentials, a record is inserted in the phabricator_user.user_log table with action = login-fail.
The session value of this record is set to null in this case.

When you open the People → Activity Logs screen, you will see an exception because of this.

Fixes T15555

Test Plan: Go to https://my.phorge.site/people/logs/ after a login failure and a login success.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15555

Differential Revision: https://we.phorge.it/D25351
This commit is contained in:
Steve Campbell 2023-07-17 13:02:17 +01:00
parent 849e18ccbb
commit dbc101ca8a

View file

@ -36,7 +36,7 @@ final class PhabricatorUserLogView extends AphrontView {
$rows = array();
foreach ($logs as $log) {
$session = substr($log->getSession(), 0, 6);
$session = substr(coalesce($log->getSession(), ''), 0, 6);
$actor_phid = $log->getActorPHID();
$user_phid = $log->getUserPHID();