Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception inCelerityResourceController to make CSS/JS load
ClosedPublic

Authored by aklapper on Apr 27 2023, 08:10.

Details

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

Diff Detail

Repository
rP Phorge
Branch
T15283 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 275
Build 275: arc lint + arc unit

Event Timeline

I honestly was not able to reproduce in PHP 8.1 for unknown reasons. I tried enabling registration and registering an account, and I tried also from the internal people menu.

Maybe my computer always sends the HTTP-Range (?) Don't know.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range

Anyway,

sgtm

src/applications/celerity/controller/CelerityResourceController.php
116

✅ the default of getHTTPHeader() is null (and not false or whatever) so phutil_nonempty_string should receive a correct input domain of string and null.

./src/aphront/AphrontRequest.php
public static function getHTTPHeader($name, $default = null, $data = null)
This revision is now accepted and ready to land.Apr 27 2023, 08:33