flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.29k stars 832 forks source link

fix: set parameter to string in explode function #3970

Closed pplulee closed 7 months ago

pplulee commented 7 months ago

Fixes FriendsOfFlarum/user-directory#109

The issue can be reproduced in PHP8.x environment when using the extension FriendsOfFlarum/user-directory. Issue is caused by passing null parameter into function str_getcsv() in Flarum Core, where PHP8.x doesn't allow that.

Issue is solved by set the parameter to string.

Changes proposed in this pull request: GambitManager.php

Necessity

Confirmed

Required changes:

SychO9 commented 7 months ago

Hello @pplulee thanks for the PR!

The 1.x branch is only currently receiving critical patches. This is a very minor issue and involves improving your web server configuration by disabling deprecation warnings in production to avoid the likely numerous similar warnings.

I would redirect your PR to 2.x, but the 2.x code has changed a lot and likely this is solved there.

Thanks again! Feel free to send more PRs in the future.

luceos commented 7 months ago

I've confirmed this is not currently an issue in 2.x.

Thank you for your contribution, please suppress deprecations and warnings through your php.ini or using ini_set inside the config.php to go around this issue.