Skip to content

Commit 8b539a6

Browse files
authored
Filter listTables cache response on constrainPrefix
1 parent c925624 commit 8b539a6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

system/Database/BaseConnection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,9 @@ public function listTables(bool $constrainByPrefix = false)
15281528
// Is there a cached result?
15291529
if (isset($this->dataCache['table_names']) && $this->dataCache['table_names'])
15301530
{
1531-
return $this->dataCache['table_names'];
1531+
return $constrainByPrefix ?
1532+
preg_grep("/^{$this->DBPrefix}/", $this->dataCache['table_names'])
1533+
: $this->dataCache['table_names'];
15321534
}
15331535

15341536
if (false === ($sql = $this->_listTables($constrainByPrefix)))

0 commit comments

Comments
 (0)