From dbc101ca8ae1f766a099471de0a39337307e87cd Mon Sep 17 00:00:00 2001 From: Steve Campbell Date: Mon, 17 Jul 2023 13:02:17 +0100 Subject: [PATCH] Fix PHP 8.1 substr(null) in People > Activity Logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/applications/people/view/PhabricatorUserLogView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/people/view/PhabricatorUserLogView.php b/src/applications/people/view/PhabricatorUserLogView.php index cf728af973..ef4fa6f10c 100644 --- a/src/applications/people/view/PhabricatorUserLogView.php +++ b/src/applications/people/view/PhabricatorUserLogView.php @@ -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();