From f7d9d95b79f781eea88f37058aa0ffa5622995ff Mon Sep 17 00:00:00 2001 From: sten Date: Tue, 5 Sep 2023 17:02:58 +0100 Subject: [PATCH] Fix Diviner strlen(null) error when clicking on a link Summary: Fix issue whereby clicking on a link in Diviner (eg https://my.phorge.site/diviner/find/?name=Differential_User_Guide&type=article&jump=1) results in a strlen(null) error under PHP 8.1 Fixes T15635 Test Plan: * Go into the Diviner differential page /book/phorge/article/differential/ * Click on the link to Differential User Guide: Inline Comments Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15635 Differential Revision: https://we.phorge.it/D25433 --- src/applications/diviner/controller/DivinerFindController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/diviner/controller/DivinerFindController.php b/src/applications/diviner/controller/DivinerFindController.php index 1bedd65b06..2e3b121706 100644 --- a/src/applications/diviner/controller/DivinerFindController.php +++ b/src/applications/diviner/controller/DivinerFindController.php @@ -32,7 +32,7 @@ final class DivinerFindController extends DivinerController { } $context = $request->getStr('context'); - if (strlen($context)) { + if (phutil_nonempty_string($context)) { $query->withContexts(array($context)); }