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.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 1, 04:53
Unknown Object (File)
Mon, Apr 1, 01:18
Unknown Object (File)
Sun, Mar 31, 18:15
Unknown Object (File)
Sun, Mar 31, 12:16
Unknown Object (File)
Sun, Mar 31, 08:24
Unknown Object (File)
Tue, Mar 26, 22:19
Unknown Object (File)
Tue, Mar 26, 22:19
Unknown Object (File)
Tue, Mar 26, 21:24

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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