Regression #14794
closed
PHP error when adding firewall rule when the configuration contains no separators
Added by Jim Pingle 11 months ago.
Updated 9 months ago.
Plus Target Version:
23.09
Release Notes:
Force Exclusion
Description
Trying to add a firewall rule to a configuration without separators yields a PHP error:
[19-Sep-2023 15:19:37 Etc/UTC] PHP Fatal error: Uncaught TypeError: array_get_path(): Argument #1 ($arr) must be of type array, string given, called in /etc/inc/filter.inc on line 4985 and defined in /etc/inc/util.inc:3551
Stack trace:
#0 /etc/inc/filter.inc(4985): array_get_path('', 'row/0')
#1 /usr/local/www/firewall_rules_edit.php(1085): shift_separators(Array, -1)
#2 {main}
thrown in /etc/inc/util.inc on line 3551
The config.xml
section for separators is empty:
<separator></separator>
To me, I have a fix
- Status changed from New to Feedback
- % Done changed from 0 to 100
I manually added an empty <separator></separator> tag to the config and upon making a rule I didn't get any PHP errors.
Tested against:
23.09-DEVELOPMENT (amd64)
built on 20230920-1314
FreeBSD 14.0-CURRENT
However, when I tried to add a new separator I got a PHP error.
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/firewall_rules.php:325 Stack trace: #0 {main} thrown in /usr/local/www/firewall_rules.php on line 325 PHP ERROR: Type: 1, File: /usr/local/www/firewall_rules.php, Line: 325, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/firewall_rules.php:325 Stack trace: #0 {main} thrown
Please check.
- Status changed from Feedback to In Progress
I can reproduce that as well, fix coming momentarily.
- Status changed from In Progress to Feedback
- Status changed from Feedback to Resolved
The patch fixes it.
I am marking this ticket resolved.
- Target version changed from 2.8.0 to 2.7.1
Also available in: Atom
PDF