Bug #14579
closed
PHP error in ``handle_wireless_post()`` when toggling some wireless interface options
Added by Jonathan Lee over 1 year ago.
Updated about 1 year ago.
Plus Target Version:
23.09
Affected Architecture:
SG-2100
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
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.
- 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.
- Assignee set to Jim Pingle
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)
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.
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-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.
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.
- Related to Todo #14790: Eliminate direct config access in ``interfaces.php`` added
- Status changed from New to Feedback
- % Done changed from 0 to 100
- 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.
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
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.
- Status changed from Feedback to Resolved
- Target version changed from 2.8.0 to 2.7.1
Also available in: Atom
PDF