Environment
- Issabel: 5.0.0
- IssabelPBX: 2.12.0-5
- Asterisk: 18.19.0
- OS: Rocky Linux 8.10
- Database: MariaDB
Description
When editing an extension, IssabelPBX allows entering a Display Name longer than the database column can store.
Instead of validating the input and displaying a user-friendly message, the application executes the SQL statement and exposes a database exception.
Steps to reproduce
- Open PBX → Extensions.
- Edit an existing extension.
- Set the Display Name to a value longer than 50 characters.
Example:
ADMINISTRATIVE - IT-SUPPORT-DEPT - Some Name Here For Test
- Click Submit and then Apply Config.
Actual behavior
IssabelPBX displays a Fatal Error:
Data too long for column 'name' at row 1
The generated SQL is similar to:
INSERT INTO users
(extension,password,name,...)
VALUES
(
'EXTENSINONUMBER',
'',
'ADMINISTRATIVE - IT-SUPPORT-DEPT - Some Name Here For Test',
...
)
The stack trace shows the exception being raised while executing core_users_add().
Expected behavior
The application should validate the Display Name before attempting the INSERT.
Possible solutions:
- Prevent values longer than the allowed database limit.
- Add an HTML
maxlength attribute to the input field.
- Display a validation error such as:
Display Name cannot exceed 50 characters.
instead of exposing the SQL exception.
Additional information
The users table defines the field as:
MariaDB [asterisk]> DESCRIBE users;
+-----------+-------------+
| Field | Type |
+-----------+-------------+
| name | varchar(50) |
+-----------+-------------+
The GUI currently allows values longer than 50 characters and only fails after submitting the form.
This is therefore an input validation issue rather than a database issue.
Suggested improvement
The form should enforce the same limit defined by the database schema before executing the SQL statement, avoiding an uncaught database exception and improving the user experience.
The issue is not that the database rejects oversized values. The problem is that the UI performs no client-side or server-side validation before executing the INSERT. A simple length validation (or HTML maxlength) would prevent the fatal SQL error and provide a much better user experience.
Environment
Description
When editing an extension, IssabelPBX allows entering a Display Name longer than the database column can store.
Instead of validating the input and displaying a user-friendly message, the application executes the SQL statement and exposes a database exception.
Steps to reproduce
Example:
Actual behavior
IssabelPBX displays a Fatal Error:
The generated SQL is similar to:
The stack trace shows the exception being raised while executing
core_users_add().Expected behavior
The application should validate the Display Name before attempting the INSERT.
Possible solutions:
maxlengthattribute to the input field.instead of exposing the SQL exception.
Additional information
The
userstable defines the field as:The GUI currently allows values longer than 50 characters and only fails after submitting the form.
This is therefore an input validation issue rather than a database issue.
Suggested improvement
The form should enforce the same limit defined by the database schema before executing the SQL statement, avoiding an uncaught database exception and improving the user experience.
The issue is not that the database rejects oversized values. The problem is that the UI performs no client-side or server-side validation before executing the INSERT. A simple length validation (or HTML maxlength) would prevent the fatal SQL error and provide a much better user experience.