Page MenuHomePhorge

Fix regression in preamble
AbandonedPublic

Authored by avivey on Apr 7 2023, 21:27.

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.