Closed fritzmg closed 3 years ago
Thanks @fritzmg
Any idea why Contao's database class did no escape the folder name properly?
Any idea why Contao's database class did no escape the folder name properly?
You did not use prepared statements - the folder names where imploded as a string and used directly in the query and so there was no possibility to automatically escape anything.
You did not use prepared statements - the folder names where imploded as a string and used directly in the query
Well, seems like I was blind 😌 Thanks.
If a folder already has an unsanitized special character (e.g. because the folder existed before this extension was installed and enabled), e.g. a single quote, then the following error will appear when trying to edit that folder:
In this case the folder's name was
test's test
.This is because the database query to check whether any parent folder has the
doNotSanitize
option enabled does not currently escape the folder names.This PR fixes that by using the actual
Doctrine\DBAL\Connection
instance, together with theConnection::PARAM_STR_ARRAY
parameter type, so that a prepared statement with an array parameter can be used.This PR also fixes the erroneous
PaletteManipulator
class name (it was missingContao\
in the beginning).