Skip to content

table name needs to be quoted #39487

@Kurantje

Description

@Kurantje

Steps to reproduce the issue

Create a component (com_xxx) using a table with a special character, e.g. da-events
Go to ...?option=com_xxx&view=event&layout=edit&id=1 to get the first element from the table

Expected result

Get in edit.php the data from the da-events table for id=1

Actual result

Exception informing about sql syntax error (without insight in the actual query causing the error)

System information (as much as possible)

Joomla! Version 4.2.6
PHP Version 8.0.13
Database Server mysql
Version 10.3.28-MariaDB-cll-lve
Collation latin1_swedish_ci
Conn Collation utf8mb4_general_ci

Additional comments

The problem is in libraries/src/Table/Table.php
On line 734 it states: ->from($this->_tbl);
This should be: ->from($this->_db->quoteName($this->_tbl));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions