[BUGFIX] RootlineUtility uses backticks which leads to crashing dbal
authorNicole Cordes <nicole@cordes.co>
Tue, 20 Nov 2012 17:03:00 +0000 (18:03 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 20 Nov 2012 17:51:16 +0000 (18:51 +0100)
In some queries backticks are used to generate the WHERE clause. Those
backticks lead to an error when using dbal. Therefore they have to be
removed.

Change-Id: If6aa29f73fda93cfc122af51201730cc6475a8c1
Fixes: #43168
Release: 6.0
Reviewed-on: http://review.typo3.org/16629
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Utility/RootlineUtility.php

index 5d0e7d3..ff55f49 100644 (file)
@@ -244,17 +244,17 @@ class RootlineUtility {
                                } elseif ($configuration['foreign_field']) {
                                        $table = $configuration['foreign_table'];
                                        $field = $configuration['foreign_field'];
                                } elseif ($configuration['foreign_field']) {
                                        $table = $configuration['foreign_table'];
                                        $field = $configuration['foreign_field'];
-                                       $whereClauseParts = array('`' . $field . '` = ' . intval($uid));
+                                       $whereClauseParts = array($field . ' = ' . intval($uid));
                                        if (isset($configuration['foreign_match_fields']) && is_array($configuration['foreign_match_fields'])) {
                                                foreach ($configuration['foreign_match_fields'] as $field => $value) {
                                        if (isset($configuration['foreign_match_fields']) && is_array($configuration['foreign_match_fields'])) {
                                                foreach ($configuration['foreign_match_fields'] as $field => $value) {
-                                                       $whereClauseParts[] = '`' . $field . '` = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($value, $table);
+                                                       $whereClauseParts[] = $field . ' = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($value, $table);
                                                }
                                        }
                                        if (isset($configuration['foreign_table_field'])) {
                                                if (intval($pageRecord['sys_language_uid']) > 0) {
                                                }
                                        }
                                        if (isset($configuration['foreign_table_field'])) {
                                                if (intval($pageRecord['sys_language_uid']) > 0) {
-                                                       $whereClauseParts[] = '`' . trim($configuration['foreign_table_field']) . '` = \'pages_language_overlay\'';
+                                                       $whereClauseParts[] = trim($configuration['foreign_table_field']) . ' = \'pages_language_overlay\'';
                                                } else {
                                                } else {
-                                                       $whereClauseParts[] = '`' . trim($configuration['foreign_table_field']) . '` = \'pages\'';
+                                                       $whereClauseParts[] = trim($configuration['foreign_table_field']) . ' = \'pages\'';
                                                }
                                        }
                                        $whereClause = implode(' AND ', $whereClauseParts);
                                                }
                                        }
                                        $whereClause = implode(' AND ', $whereClauseParts);