Project

General

Profile

Actions

Bug #15907

closed

PHP error in Captive Portal with undefined zone interface list

Added by Danilo Zrenjanin 16 days ago. Updated 1 day ago.

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

100%

Estimated time:
Plus Target Version:
25.03
Release Notes:
Default
Affected Version:
Affected Architecture:

Description

Following the upgrade to version 24.11, the captive portal intermittently displays PHP error messages. However, production operations continue to function without any disruption.

I've attached the file containing the PHP error details.


Files

PHP_errors (7).log (34.9 KB) PHP_errors (7).log Danilo Zrenjanin, 12/06/2024 02:32 PM
Actions #1

Updated by Jim Pingle 15 days ago

  • Assignee set to Jim Pingle
  • Target version set to 2.8.0
  • Plus Target Version set to 25.01
[05-Dec-2024 09:37:19 Europe/Rome] PHP Fatal error:  Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /etc/inc/captiveportal.inc:1746
Stack trace:
#0 /etc/inc/captiveportal.inc(1746): explode()
#1 /etc/inc/captiveportal.inc(1802): portal_ip_from_client_ip()
#2 /etc/inc/captiveportal.inc(1823): portal_hostname_from_client_ip()
#3 /usr/local/captiveportal/index.php(60): portal_reply_page()
#4 {main}
  thrown in /etc/inc/captiveportal.inc on line 1746

Looks like this line shouldn't be using [] as the default, but "":

    $interfaces = array_filter(explode(",", config_get_path("captiveportal/{$cpzone}/interface", [])));

Actions #2

Updated by Jim Pingle 15 days ago

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

Updated by Jim Pingle 15 days ago

  • Subject changed from Intermittent PHP Error Messages in Captive Portal Post-Upgrade to Version 24.11 to PHP error in Captive Portal with undefined zone interface list
Actions #4

Updated by Jim Pingle 12 days ago

  • Plus Target Version changed from 25.01 to 25.03
Actions #5

Updated by Marcos M 1 day ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF