mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 15:05:45 +00:00
BUG Unescaped underscore in query unintentionally hid any table beginning with 'SQL' or 'PG'
This commit is contained in:
parent
7ba07e905d
commit
9b623a2b2b
@ -1264,7 +1264,7 @@ class PostgreSQLDatabase extends SS_Database {
|
|||||||
public function tableList() {
|
public function tableList() {
|
||||||
$schema_SQL = pg_escape_string($this->dbConn, $this->schema);
|
$schema_SQL = pg_escape_string($this->dbConn, $this->schema);
|
||||||
$tables=array();
|
$tables=array();
|
||||||
foreach($this->query("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = '{$schema_SQL}' AND tablename NOT ILIKE 'pg_%' AND tablename NOT ILIKE 'sql_%'") as $record) {
|
foreach($this->query("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = '{$schema_SQL}' AND tablename NOT ILIKE 'pg\_%' AND tablename NOT ILIKE 'sql\_%'") as $record) {
|
||||||
//$table = strtolower(reset($record));
|
//$table = strtolower(reset($record));
|
||||||
$table = reset($record);
|
$table = reset($record);
|
||||||
$tables[$table] = $table;
|
$tables[$table] = $table;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user