From 112aafe5137220181dd74afc509fa6cd39573028 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 6 Dec 2009 19:51:00 -0800 Subject: Oops, removed the overload for query() before, we need this back so that we can prefix table names properly. --- modules/gallery/libraries/MY_Database.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules/gallery/libraries/MY_Database.php') diff --git a/modules/gallery/libraries/MY_Database.php b/modules/gallery/libraries/MY_Database.php index 0f29c09b..52bc46d6 100644 --- a/modules/gallery/libraries/MY_Database.php +++ b/modules/gallery/libraries/MY_Database.php @@ -20,6 +20,17 @@ abstract class Database extends Database_Core { protected $_table_names; + /** + * Parse the query string and convert any strings of the form `\([a-zA-Z0-9_]*?)\] + * table prefix . $1 + */ + public function query($sql = '') { + if (!empty($sql)) { + $sql = $this->add_table_prefixes($sql); + } + return parent::query($sql); + } + public function add_table_prefixes($sql) { $prefix = $this->config["table_prefix"]; if (strpos($sql, "SHOW TABLES") === 0) { -- cgit v1.2.3