Project

General

Profile

Task #55370 » 0001-Remove-the-strlen-functions-in-the-DatabaseConnectio.patch

Tim Lochmüller, 2014-01-27 20:02

View differences:

typo3/sysext/core/Classes/Database/DatabaseConnection.php
}
}
// Build query
$query = 'UPDATE ' . $table . ' SET ' . implode(',', $fields) . (strlen($where) > 0 ? ' WHERE ' . $where : '');
$query = 'UPDATE ' . $table . ' SET ' . implode(',', $fields) . ($where ? ' WHERE ' . $where : '');
if ($this->debugOutput || $this->store_lastBuiltQuery) {
$this->debug_lastBuiltQuery = $query;
}
......
$hookObject->DELETEquery_preProcessAction($table, $where, $this);
}
// Table and fieldnames should be "SQL-injection-safe" when supplied to this function
$query = 'DELETE FROM ' . $table . (strlen($where) > 0 ? ' WHERE ' . $where : '');
$query = 'DELETE FROM ' . $table . ($where ? ' WHERE ' . $where : '');
if ($this->debugOutput || $this->store_lastBuiltQuery) {
$this->debug_lastBuiltQuery = $query;
}
......
}
// Table and fieldnames should be "SQL-injection-safe" when supplied to this function
// Build basic query
$query = 'SELECT ' . $select_fields . ' FROM ' . $from_table . (strlen($where_clause) > 0 ? ' WHERE ' . $where_clause : '');
$query = 'SELECT ' . $select_fields . ' FROM ' . $from_table . ($where_clause ? ' WHERE ' . $where_clause : '');
// Group by
$query .= strlen($groupBy) > 0 ? ' GROUP BY ' . $groupBy : '';
$query .= $groupBy ? ' GROUP BY ' . $groupBy : '';
// Order by
$query .= strlen($orderBy) > 0 ? ' ORDER BY ' . $orderBy : '';
$query .= $orderBy ? ' ORDER BY ' . $orderBy : '';
// Group by
$query .= strlen($limit) > 0 ? ' LIMIT ' . $limit : '';
$query .= $limit ? ' LIMIT ' . $limit : '';
// Return query
if ($this->debugOutput || $this->store_lastBuiltQuery) {
$this->debug_lastBuiltQuery = $query;
......
public function SELECTsubquery($select_fields, $from_table, $where_clause) {
// Table and fieldnames should be "SQL-injection-safe" when supplied to this function
// Build basic query:
$query = 'SELECT ' . $select_fields . ' FROM ' . $from_table . (strlen($where_clause) > 0 ? ' WHERE ' . $where_clause : '');
$query = 'SELECT ' . $select_fields . ' FROM ' . $from_table . ($where_clause ? ' WHERE ' . $where_clause : '');
// Return query
if ($this->debugOutput || $this->store_lastBuiltQuery) {
$this->debug_lastBuiltQuery = $query;
(2-2/2)