add only slashes where required
This commit is contained in:
@@ -219,9 +219,9 @@ function PMA_DBI_get_tables_full($database, $table = false,
|
|||||||
{
|
{
|
||||||
// prepare and check parameters
|
// prepare and check parameters
|
||||||
if (! is_array($database)) {
|
if (! is_array($database)) {
|
||||||
$databases = array(addslashes($database));
|
$databases = array($database);
|
||||||
} else {
|
} else {
|
||||||
$databases = array_map('addslashes', $database);
|
$databases = $database;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tables = array();
|
$tables = array();
|
||||||
@@ -249,6 +249,8 @@ function PMA_DBI_get_tables_full($database, $table = false,
|
|||||||
// added BINARY in the WHERE clause to force a case sensitive
|
// added BINARY in the WHERE clause to force a case sensitive
|
||||||
// comparison (if we are looking for the db Aa we don't want
|
// comparison (if we are looking for the db Aa we don't want
|
||||||
// to find the db aa)
|
// to find the db aa)
|
||||||
|
$this_databases = array_map('PMA_sqlAddslashes', $databases);
|
||||||
|
|
||||||
$sql = '
|
$sql = '
|
||||||
SELECT *,
|
SELECT *,
|
||||||
`TABLE_SCHEMA` AS `Db`,
|
`TABLE_SCHEMA` AS `Db`,
|
||||||
@@ -272,7 +274,7 @@ function PMA_DBI_get_tables_full($database, $table = false,
|
|||||||
`CREATE_OPTIONS` AS `Create_options`,
|
`CREATE_OPTIONS` AS `Create_options`,
|
||||||
`TABLE_COMMENT` AS `Comment`
|
`TABLE_COMMENT` AS `Comment`
|
||||||
FROM `information_schema`.`TABLES`
|
FROM `information_schema`.`TABLES`
|
||||||
WHERE ' . (PMA_IS_WINDOWS ? '' : 'BINARY') . ' `TABLE_SCHEMA` IN (\'' . implode("', '", $databases) . '\')
|
WHERE ' . (PMA_IS_WINDOWS ? '' : 'BINARY') . ' `TABLE_SCHEMA` IN (\'' . implode("', '", $this_databases) . '\')
|
||||||
' . $sql_where_table;
|
' . $sql_where_table;
|
||||||
|
|
||||||
$tables = PMA_DBI_fetch_result($sql, array('TABLE_SCHEMA', 'TABLE_NAME'),
|
$tables = PMA_DBI_fetch_result($sql, array('TABLE_SCHEMA', 'TABLE_NAME'),
|
||||||
@@ -365,7 +367,7 @@ function PMA_DBI_get_tables_full($database, $table = false,
|
|||||||
// with SHOW DATABASES or information_schema.SCHEMATA: `Test`
|
// with SHOW DATABASES or information_schema.SCHEMATA: `Test`
|
||||||
// but information_schema.TABLES gives `test`
|
// but information_schema.TABLES gives `test`
|
||||||
// bug #1436171
|
// bug #1436171
|
||||||
// sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
|
// http://sf.net/support/tracker.php?aid=1436171
|
||||||
return $tables[strtolower($database)];
|
return $tables[strtolower($database)];
|
||||||
} else {
|
} else {
|
||||||
return $tables;
|
return $tables;
|
||||||
|
Reference in New Issue
Block a user