From: Wouter Wolters Date: Tue, 14 Nov 2017 18:05:15 +0000 (+0100) Subject: [BUGFIX] Use correct parameters for trimExplode X-Git-Tag: v9.0.0~240 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/e6878a52487c4454bb7a2943d722e31f240c5689 [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: Jigal van Hemert Tested-by: Jigal van Hemert Tested-by: TYPO3com Reviewed-by: Tymoteusz Motylewski Tested-by: Tymoteusz Motylewski --- diff --git a/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php b/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php index 0d013045a0f3..45db0f8d132c 100644 --- a/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php +++ b/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php @@ -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 . '"',