Actions
Regression #14172
closedPHP error in Captive Portal if ``usedmacs`` list is empty
Start date:
Due date:
% Done:
100%
Estimated time:
Plus Target Version:
23.05
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:
amd64
Description
PHP Errors:
[23-Mar-2023 19:32:38] PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /etc/inc/captiveportal.inc:2354
Stack trace:
#0 /etc/inc/captiveportal.inc(2354): implode('\n', '')
#1 /etc/rc.carpmaster(196): captiveportal_write_usedmacs_db('')
#2 {main}
thrown in /etc/inc/captiveportal.inc on line 2354
This is after exporting a pfSense CE 2.6.0 config without Extras, i.e. without used captive portal information, and importing it back into pfSense Plus 23.01.
Of course then there are no usedmacs in the list/database and it seems to want to read that \n terminated list, creating an array out of it. But as there is nothing there, no array is generated. Thus the error.
At least this is what it looks like to me.
Related issues
Updated by Jim Pingle almost 2 years ago
- Tracker changed from Bug to Regression
- Project changed from pfSense Plus to pfSense
- Subject changed from Captive Portal - Crash Report if list of usedmacs is empty to PHP error in Captive Portal if ``usedmacs`` list is empty
- Category changed from Captive Portal to Captive Portal
- Target version set to 2.7.0
- Affected Plus Version deleted (
23.01) - Plus Target Version set to 23.05
Updated by Jim Pingle over 1 year ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 3dfbc1fa812b2131b11c176ce22de9b2d8d233ea.
Updated by Jim Pingle over 1 year ago
- Status changed from Feedback to Resolved
The change fixes the error. I could induce the error before by manually running captiveportal_write_usedmacs_db("");
but with the patch applied there is no error.
Updated by Christopher Cope over 1 year ago
- Related to Bug #14446: PHP error in Captive Portal ``usedmacs`` handling added
Actions