1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Fix PHP 8.1 "strlen(null)" exception which blocks rendering "Browse Dashboards" dialog

Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.

But, that function does not accept null anymore since PHP 8.1.

Closes T15396

Test Plan: Applied this change (on top of D25179 and D25226) and the "Browse Dashboards" dialog got 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: T15396

Differential Revision: https://we.phorge.it/D25227
This commit is contained in:
Andre Klapper 2023-05-19 11:59:23 +02:00
parent 2df7ea13a3
commit 402a63c5de

View file

@ -103,7 +103,9 @@ final class PhutilSearchQueryCompiler
private function tokenizeQuery($query) { private function tokenizeQuery($query) {
$maximum_bytes = 1024; $maximum_bytes = 1024;
if ($query === null) {
$query = '';
}
$query_bytes = strlen($query); $query_bytes = strlen($query);
if ($query_bytes > $maximum_bytes) { if ($query_bytes > $maximum_bytes) {
throw new PhutilSearchQueryCompilerSyntaxException( throw new PhutilSearchQueryCompilerSyntaxException(