Skip to content
Snippets Groups Projects
Commit b2ef87f3 authored by Helmut Hummel's avatar Helmut Hummel Committed by Wouter Wolters
Browse files

[TASK] Harden database queries in LocalizationController

Resolves: #71442
Releases: master
Change-Id: Id4480dfd18913add55f07ca030cc2d56ba85974f
Reviewed-on: https://review.typo3.org/44644


Reviewed-by: default avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: default avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
parent 5e205b5b
No related branches found
No related tags found
No related merge requests found
......@@ -76,9 +76,9 @@ class LocalizationController
$elementsInColumnCount = $databaseConnection->exec_SELECTcountRows(
'uid',
'tt_content',
'tt_content.sys_language_uid=' . $languageId
. ' AND tt_content.colPos = ' . $colPos
. ' AND tt_content.pid=' . $pageId
'tt_content.sys_language_uid=' . (int)$languageId
. ' AND tt_content.colPos = ' . (int)$colPos
. ' AND tt_content.pid=' . (int)$pageId
. $excludeQueryPart
);
$additionalWhere = '';
......@@ -94,16 +94,15 @@ class LocalizationController
'sys_language.uid',
'tt_content,sys_language',
'tt_content.sys_language_uid=sys_language.uid'
. ' AND tt_content.colPos = ' . $colPos
. ' AND tt_content.pid=' . $pageId
. ' AND sys_language.uid <> ' . $languageId
. ' AND tt_content.colPos = ' . (int)$colPos
. ' AND tt_content.pid=' . (int)$pageId
. ' AND sys_language.uid <> ' . (int)$languageId
. $additionalWhere
. $excludeQueryPart,
'tt_content.sys_language_uid',
'sys_language.title'
);
while ($row = $databaseConnection->sql_fetch_assoc($res)) {
$row['uid'] = (int)$row['uid'];
if (isset($systemLanguages[$row['uid']])) {
$availableLanguages[] = $systemLanguages[$row['uid']];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment