From 0d81da5909239d404b92f69848b858257b564b4e Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Mon, 29 May 2023 12:35:37 +0200 Subject: [PATCH] Fix PHP 8.1 "explode(null)" exception which blocks rendering the Multimeter page Summary: Passing null as an input string to explode() is deprecated in PHP 8. Thus first check via `phutil_nonempty_string()` that the input string is not null. Note: this may highlight other absurd input values that might be worth correcting instead of just ignoring. If phutil_nonempty_string() throws an exception in your instance, report it to Phorge to evaluate and fix that specific corner case. Closes T15361 Test Plan: Applied this change; afterwards `/multimeter/` correctly rendered in web browser. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15361 Differential Revision: https://we.phorge.it/D25254 --- .../multimeter/controller/MultimeterSampleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/multimeter/controller/MultimeterSampleController.php b/src/applications/multimeter/controller/MultimeterSampleController.php index 190a839f63..0aca60f0e1 100644 --- a/src/applications/multimeter/controller/MultimeterSampleController.php +++ b/src/applications/multimeter/controller/MultimeterSampleController.php @@ -10,7 +10,7 @@ final class MultimeterSampleController extends MultimeterController { $viewer = $this->getViewer(); $group_map = $this->getColumnMap(); - $group = explode('.', $request->getStr('group')); + $group = explode('.', $request->getStr('group', '')); $group = array_intersect($group, array_keys($group_map)); $group = array_fuse($group);