Project

General

Profile

Actions

Bug #12891

closed

Trailing space in Acme Account Keys "name" breaks UI functions

Added by Karl Fife over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
ACME
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

If any ACME account key is entered into the UI with a trailing space in the name, the pfSense UI becomes unable to handle that entry (i.e. becomes unable to edit, delete, or copy the entry).

pfSense will store trailing space (or spaces) in the config, e.g.

<name>LE Staging v2 Account </name>

However, when attempting to view/edit/delete/copy the entry, the name of the key is passed to the PHP function without the trailing space, thus it is a mismatch for the stored item name.
e.g.
.../acme/acme_accountkeys_edit.php?id=LE%20Staging%20v2%20Account
instead of the stored name:
.../acme/acme_accountkeys_edit.php?id=LE%20Staging%20v2%20Account%20

Clicking 'edit' in the UI shows blank values in the 'edit' view as if they had been directed to id=foo.
It then becomes impossible for a user to recover from within the UI (as by deletion or editing).

Steps to reproduce:
From .../acme/acme_accountkeys.php:
click the 'edit' icon for any account key.
In the detail view for the key, add a trailing space.
Save the entry.

click the 'edit' icon again. You will not be able to edit the entry.
click the 'delete' icon. You will not be able to delete the entry.
click the 'copy' icon. You will not be able to copy the entry.

Validate the nature of the mismatch by manually passing the item's proper URL by appending an encoded space (as above) to edit the 'problem' entry in the UI. Remove the space and hit save.
The UI again behaves as expected.

I think the desired behavior is to to trim trailing white space before writing the name to the config, but if not, the actual item name should be passed.

Actions

Also available in: Atom PDF