mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
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
This commit is contained in:
parent
2da7594344
commit
eb2be08f9f
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ final class PhabricatorSearchController
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
$query = $request->getStr('query');
|
$query = $request->getStr('query');
|
||||||
|
|
||||||
if ($request->getStr('jump') != 'no' && strlen($query)) {
|
if ($request->getStr('jump') != 'no' && phutil_nonempty_string($query)) {
|
||||||
$jump_uri = id(new PhabricatorDatasourceEngine())
|
$jump_uri = id(new PhabricatorDatasourceEngine())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->newJumpURI($query);
|
->newJumpURI($query);
|
||||||
|
|
Loading…
Reference in a new issue