From f3b37413167ecbf6bb6a8f7ecd0d6cdc371b2bfd Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 27 Apr 2023 10:49:06 +0200 Subject: [PATCH] Fix PHP 8.1 "strlen(null)" exception inCelerityResourceController to make CSS/JS load Summary: On a fresh installation with PHP 8.1, CSS does not load on the account creation page. Closes T15283 Test Plan: After applying this change (and D25137), the account creation page is rendered correctly. See the screenshot in T15283 Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15283 Differential Revision: https://we.phorge.it/D25138 --- .../celerity/controller/CelerityResourceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/celerity/controller/CelerityResourceController.php b/src/applications/celerity/controller/CelerityResourceController.php index 702fcefb2c..547c881df8 100644 --- a/src/applications/celerity/controller/CelerityResourceController.php +++ b/src/applications/celerity/controller/CelerityResourceController.php @@ -113,7 +113,7 @@ abstract class CelerityResourceController extends PhabricatorController { $range = AphrontRequest::getHTTPHeader('Range'); - if (strlen($range)) { + if (phutil_nonempty_string($range)) { $response->setContentLength(strlen($data)); list($range_begin, $range_end) = $response->parseHTTPRange($range);