Project

General

Profile

Actions

Regression #14172

closed

PHP error in Captive Portal if ``usedmacs`` list is empty

Added by name name about 1 year ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Captive Portal
Target version:
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

Related to Bug #14446: PHP error in Captive Portal ``usedmacs`` handlingResolvedChristopher Cope

Actions
Actions #1

Updated by Jim Pingle about 1 year 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
Actions #2

Updated by Jim Pingle 12 months ago

  • Assignee set to Jim Pingle
Actions #3

Updated by Jim Pingle 12 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Jim Pingle 11 months 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.

Actions #5

Updated by Christopher Cope 10 months ago

  • Related to Bug #14446: PHP error in Captive Portal ``usedmacs`` handling added
Actions #6

Updated by Jim Pingle 10 months ago

  • Affected Version set to 2.7.0
Actions

Also available in: Atom PDF