Bug #15907
closedPHP error in Captive Portal with undefined zone interface list
100%
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
Updated by Jim Pingle about 1 month 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", [])));
Updated by Jim Pingle about 1 month ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 64075a4359d070c300e09a94c2cf1f4854ce649b.
Updated by Jim Pingle about 1 month 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
Updated by Jim Pingle about 1 month ago
- Plus Target Version changed from 25.01 to 25.03
Updated by Gertjan KROEB 28 days ago
See also here : https://forum.netgate.com/topic/195520/issues-after-update-from-24-03-to-24-11/14
and here : https://forum.netgate.com/topic/195697/php-error-type-1
Afaik : portal_reply_page() presumes a valid $cpzone, or the test on line 59 ( if (empty($cpcfg)) { ) failed == no valid &cpzone parameter found.
portal_reply_page() (line 60, index.php, can not be sued here )
Updated by Jim Pingle 18 days ago
Gertjan KROEB wrote in #note-6:
See also here : https://forum.netgate.com/topic/195520/issues-after-update-from-24-03-to-24-11/14
and here : https://forum.netgate.com/topic/195697/php-error-type-1Afaik : portal_reply_page() presumes a valid $cpzone, or the test on line 59 ( if (empty($cpcfg)) { ) failed == no valid &cpzone parameter found.
portal_reply_page() (line 60, index.php, can not be sued here )
Those are different, unrelated errors. Those belong in separate redmine issues.