summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_active_rec.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index add0b8c94..bde43abf0 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1434,17 +1434,15 @@ class CI_DB_active_record extends CI_DB_driver {
*/
function _filter_table_aliases($statements)
{
+
foreach ($statements as $k => $v)
{
foreach ($this->ar_aliased_tables as $table)
{
- $statement = preg_replace('/(\w+\.\w+)/', $this->_protect_identifiers('$0'), $v); // makes `table.field`
- $statement = str_replace(array($this->dbprefix.$table, '.'), array($table, $this->_protect_identifiers('.')), $statement);
+ $statements[$k] = preg_replace('/(\w+\.\w+)/', $this->_protect_identifiers('$0'), $statements[$k]); // makes `table.field`
+ $statements[$k] = str_replace($this->dbprefix.$table.'.', $table.'.', $statements[$k]);
}
-
- $statements[$k] = $statement;
}
-
return $statements;
}