Project

General

Profile

Actions

Bug #14446

closed

PHP error in Captive Portal ``usedmacs`` handling

Added by Christopher Cope 11 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Category:
Captive Portal
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.05.1
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:

Description

[03-Jun-2023 12:26:11 US/Eastern] PHP Fatal error:  Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given in /etc/inc/captiveportal.inc:2354
Stack trace:
#0 /etc/inc/captiveportal.inc(2354): trim(Array)
#1 /etc/rc.carpmaster(196): captiveportal_write_usedmacs_db(Array)
#2 {main}
  thrown in /etc/inc/captiveportal.inc on line 2354

Getting this on
23.05-RELEASE (amd64)
built on Mon May 22 15:04:36 UTC 2023
FreeBSD 14.0-CURRENT

Based on the code I'm not sure how an array is getting to that point, since the code is wrapped with "!is_array()". Trying to narrow it down.

Related issues

Related to Regression #14172: PHP error in Captive Portal if ``usedmacs`` list is emptyResolvedJim Pingle

Actions
Actions #1

Updated by Christopher Cope 11 months ago

  • Related to Regression #14172: PHP error in Captive Portal if ``usedmacs`` list is empty added
Actions #2

Updated by Christopher Cope 11 months ago

  • Assignee set to Christopher Cope

I misread the code at first. It uses an or statement, so if $usedmacs is an array it tries to trim it and check if it is empty. This is invalid since trim expects a string. Merge request coming shortly.

Actions #3

Updated by Christopher Cope 11 months ago

  • Status changed from New to Pull Request Review
Actions #4

Updated by Jim Pingle 11 months ago

  • Subject changed from PHP error in Captive Portal to PHP error in Captive Portal ``usedmacs`` handling
Actions #5

Updated by Christopher Cope 11 months ago

  • Status changed from Pull Request Review to Feedback
  • % Done changed from 0 to 100
Actions #6

Updated by Jim Pingle 11 months ago

  • Target version set to 2.7.0
  • Plus Target Version set to 23.05.1
Actions #7

Updated by Jim Pingle 11 months ago

  • Affected Version set to 2.7.0
Actions #8

Updated by Marcos M 10 months ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF