@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix PHP 8.1/8.2 "strlen(null)" exception in SearchController

Summary:
strlen() was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261];
PHP message: arcanist(head=master, ref.master=6e4947b55f09), phorge(head=master, ref.master=7bebfa289aa1);
PHP message: #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/search/controller/PhabricatorSearchController.php:16];

Fix T15595

Test Plan: Search something using the main search bar. It should return something (or not) instead to throwing a RuntimeException.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15595

Differential Revision: https://we.phorge.it/D25380

bob eb2be08f 2da75943

+1 -1
+1 -1
src/applications/search/controller/PhabricatorSearchController.php
··· 13 13 $viewer = $this->getViewer(); 14 14 $query = $request->getStr('query'); 15 15 16 - if ($request->getStr('jump') != 'no' && strlen($query)) { 16 + if ($request->getStr('jump') != 'no' && phutil_nonempty_string($query)) { 17 17 $jump_uri = id(new PhabricatorDatasourceEngine()) 18 18 ->setViewer($viewer) 19 19 ->newJumpURI($query);