Skip to content
Snippets Groups Projects
Commit e6878a52 authored by Wouter Wolters's avatar Wouter Wolters Committed by Tymoteusz Motylewski
Browse files

[BUGFIX] Use correct parameters for trimExplode

In QueryBuilder::quoteIdentifiersForSelect the 3rd parameter of
trimExplode is inserted. To prevent notices array_pad is added.

Resolves: #82995
Releases: master,8.7
Change-Id: If35efcf5c8c3fd5b0360ae8795f9b92ae87250ab
Reviewed-on: https://review.typo3.org/54640


Reviewed-by: default avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: default avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: default avatarTymoteusz Motylewski <t.motylewski@gmail.com>
parent 5b5336f6
Branches
Tags
No related merge requests found
......@@ -969,7 +969,16 @@ class QueryBuilder
public function quoteIdentifiersForSelect(array $input): array
{
foreach ($input as &$select) {
list($fieldName, $alias, $suffix) = GeneralUtility::trimExplode(' AS ', str_ireplace(' as ', ' AS ', $select), 3);
list($fieldName, $alias, $suffix) = array_pad(
GeneralUtility::trimExplode(
' AS ',
str_ireplace(' as ', ' AS ', $select),
true,
3
),
3,
null
);
if (!empty($suffix)) {
throw new \InvalidArgumentException(
'QueryBuilder::quoteIdentifiersForSelect() could not parse the input "' . $input . '"',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment