Page MenuHomePhorge

Fix regression in preamble
AbandonedPublic

Authored by avivey on Apr 7 2023, 21:27.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 21, 04:48
Unknown Object (File)
Thu, Mar 14, 08:22
Unknown Object (File)
Thu, Mar 14, 07:58
Unknown Object (File)
Thu, Mar 14, 07:52
Unknown Object (File)
Mon, Mar 4, 19:17
Unknown Object (File)
Feb 25 2024, 07:46
Unknown Object (File)
Feb 22 2024, 06:36
Unknown Object (File)
Feb 20 2024, 18:32

Details

Summary

Phutil is not yet loaded during preamble, so we can't use it.

This change fixes a regression introduced here, fixing PHP 8.1 support:

rP96ae4ba13acb: PHP 8.1: fixes for strlen() not accepting NULL anymore, part 2

Ref T15064

Test Plan

Run instance with non-empty HTTP_X_FORWARDED_FOR header, instance doesn't crash.

Diff Detail

Repository
rP Phorge
Branch
fix-preamble
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 239
Build 239: arc lint + arc unit

Event Timeline

support/startup/preamble-utils.php
24

This is a safe method to skip non-strings, NULL, or empty strings.

Honestly we can also go for if(!$forwarded_for) since we are not interested in zero and it would be more readable.

Feel free to reopen. It skips non strings, non NULL, and empty strings again without the need of that function.

Hoping to be useful, this is ready for land from you.

This is a safe method to skip non-strings, NULL, and empty strings.

I leave this in an "abandoned" state but feel free to reopen.