Project

General

Profile

Actions

Regression #14412

closed

PHP error when attempting to bulk import Alias content

Added by Jim Pingle over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Very High
Assignee:
Category:
Aliases / Tables
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.05.1
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:

Description

Saving after attempting bulk import of a new alias on firewall_aliases_import.php results in the alias configuration being broken and PHP errors on every GUI page and console prevent making any changes.

When saving after import, the configuration section for aliases ends up as:

    <aliases>
        <alias>0</alias>
    </aliases>

Where the content is the next alias ID. For example, if there were one existing alias at the time, the value is 1. If there are 5, it's 5, and so on.

The PHP error is due to the corrupted alias configuration and isn't as important:

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/util.inc:2053
Stack trace:
#0 /etc/inc/config.gui.inc(56): alias_make_table()
#1 /etc/inc/auth.inc(34): require_once('/etc/inc/config...')
#2 /etc/inc/authgui.inc(27): include_once('/etc/inc/auth.i...')
#3 /usr/local/www/guiconfig.inc(62): require_once('/etc/inc/authgu...')
#4 /usr/local/www/firewall_aliases.php(35): require_once('/usr/local/www/...')
#5 {main}
  thrown in /etc/inc/util.inc on line 2053

That error doesn't necessarily need fixed here if we can prevent the data from being corrupted, but it might be nice to have that bail in a more user-friendly way.

Actions

Also available in: Atom PDF