BUG Unescaped underscore in query unintentionally hid any table beginning with 'SQL' or 'PG'

This commit is contained in:
Damian Mooyman 2012-11-16 14:40:10 +13:00
parent 7ba07e905d
commit 9b623a2b2b

View File

@ -1264,7 +1264,7 @@ class PostgreSQLDatabase extends SS_Database {
public function tableList() {
$schema_SQL = pg_escape_string($this->dbConn, $this->schema);
$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 = reset($record);
$tables[$table] = $table;