Bug #14579
closedPHP error in ``handle_wireless_post()`` when toggling some wireless interface options
100%
Description
Hello fellow redmine community members. I found a php error when I change SSID to hidden. WiFi card works otherwise.
[14-Jul-2023 17:16:50 US/Pacific] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1800
Stack trace:
#0 /usr/local/www/interfaces.php(1676): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1800
[14-Jul-2023 17:17:38 US/Pacific] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1800
Stack trace:
#0 /usr/local/www/interfaces.php(1676): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1800
[14-Jul-2023 17:18:06 US/Pacific] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1800
Stack trace:
#0 /usr/local/www/interfaces.php(1676): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1800
Files
Related issues
Updated by Kris Phillips over 1 year ago
Tested this on 23.09 DEVELOPMENT builds. I'm not able to reproduce this, so either something else is needed to recreate this or it was fixed along the way.
Updated by Jim Pingle over 1 year ago
- Project changed from pfSense Plus to pfSense
- Category changed from Wireless to Wireless
- Target version set to 2.8.0
- Affected Plus Version deleted (
23.05.1) - Plus Target Version set to 23.09
The same could happen on CE, not just Plus. There are several places there for that and other settings nearby which could lead to PHP errors. On CE the lines in this error message are around ~1747, not ~1800. It's blindly setting a value several layers deep in a variable without checking if the components are an array first.
That whole section is a bit of a mess and could do with being updated to use safe array access get/set functions.
Updated by Michael Pfsense about 1 year ago
I also have this problem when trying to take a wificard interface from SSID broadcast to no SSID broadcast on 2.7.0-RELEASE (amd64)
Updated by Michael Pfsense about 1 year ago
Crash report begins. Anonymous machine information:
amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT #1 RELENG_2_7_0-n255866-686c8d3c1f0: Wed Jun 28 04:21:19 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/obj/amd64/LwYAddCr/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/sources/FreeBSD-src-REL
Crash report details:
PHP Errors:
[09-Sep-2023 16:25:16 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:29 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:43 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:54 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
No FreeBSD crash data found.
Updated by Kris Phillips about 1 year ago
Michael Pfsense wrote in #note-5:
Crash report begins. Anonymous machine information:
amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT #1 RELENG_2_7_0-n255866-686c8d3c1f0: Wed Jun 28 04:21:19 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/obj/amd64/LwYAddCr/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/sources/FreeBSD-src-RELCrash report details:
PHP Errors:
[09-Sep-2023 16:25:16 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:29 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:43 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:54 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748No FreeBSD crash data found.
Hello Michael,
What are the exact reproduction steps you are taking to recreate this? I'm still unable to reproduce this issue on my test hardware.
Updated by Jim Pingle about 1 year ago
- Related to Todo #14790: Eliminate direct config access in ``interfaces.php`` added
Updated by Jim Pingle about 1 year ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 1857f9fbf03ad0ea7435c87a3289c5d6da50dc54.
Updated by Jim Pingle about 1 year ago
- Subject changed from handle_wireless_post() php error to PHP error in ``handle_wireless_post()`` when toggling some wireless interface options
Updating subject for release notes.
Updated by Lev Prokofev about 1 year ago
I was able to replicate the issue on
23.09-DEVELOPMENT (amd64) built on Thu Sep 07 06:05:43 UTC 2023 FreeBSD 14.0-ALPHA2
the changeset (1857f9fbf03ad0ea7435c87a3289c5d6da50dc54) was applied, going to test it on the latest build
PHP ERROR: Type: 1, File: /usr/local/www/interfaces.php, Line: 1796, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1796
Stack trace:
#0 /usr/local/www/interfaces.php(1672): handle_wireless_post()
#1 {main}
thrown @ 2023-09-23 10:43:51
Updated by Lev Prokofev about 1 year ago
Can't reproduce on the
23.09-DEVELOPMENT (amd64) built on 20230922-1539 FreeBSD 14.0-CURRENT
I suppose it can be marked as resolved.
Updated by Jim Pingle about 1 year ago
- Status changed from Feedback to Resolved
Updated by Jim Pingle about 1 year ago
- Target version changed from 2.8.0 to 2.7.1