summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/cubrid/cubrid_driver.php9
-rw-r--r--system/database/drivers/ibase/ibase_driver.php6
-rw-r--r--system/database/drivers/mssql/mssql_driver.php4
-rw-r--r--system/database/drivers/mysql/mysql_driver.php4
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php4
-rw-r--r--system/database/drivers/pdo/pdo_result.php2
-rw-r--r--system/database/drivers/sqlite3/sqlite3_driver.php2
7 files changed, 10 insertions, 21 deletions
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php
index 138b0ed45..c5cb79683 100644
--- a/system/database/drivers/cubrid/cubrid_driver.php
+++ b/system/database/drivers/cubrid/cubrid_driver.php
@@ -264,14 +264,7 @@ class CI_DB_cubrid_driver extends CI_DB {
*/
protected function _escape_str($str)
{
- if (function_exists('cubrid_real_escape_string') &&
- (is_resource($this->conn_id)
- OR (get_resource_type($this->conn_id) === 'Unknown' && preg_match('/Resource id #/', strval($this->conn_id)))))
- {
- return cubrid_real_escape_string($str, $this->conn_id);
- }
-
- return addslashes($str);
+ return cubrid_real_escape_string($str, $this->conn_id);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php
index b19985c37..f4e5aef7c 100644
--- a/system/database/drivers/ibase/ibase_driver.php
+++ b/system/database/drivers/ibase/ibase_driver.php
@@ -219,11 +219,11 @@ class CI_DB_ibase_driver extends CI_DB {
*/
protected function _list_tables($prefix_limit = FALSE)
{
- $sql = 'SELECT "RDB$RELATION_NAME" FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\'';
+ $sql = 'SELECT TRIM("RDB$RELATION_NAME") AS TABLE_NAME FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\'';
if ($prefix_limit !== FALSE && $this->dbprefix !== '')
{
- return $sql.' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' "
+ return $sql.' AND TRIM("RDB$RELATION_NAME") AS TABLE_NAME LIKE \''.$this->escape_like_str($this->dbprefix)."%' "
.sprintf($this->_like_escape_str, $this->_like_escape_chr);
}
@@ -242,7 +242,7 @@ class CI_DB_ibase_driver extends CI_DB {
*/
protected function _list_columns($table = '')
{
- return 'SELECT "RDB$FIELD_NAME" FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table);
+ return 'SELECT TRIM("RDB$FIELD_NAME") AS COLUMN_NAME FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index f4a166180..8d830fb51 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -143,8 +143,8 @@ class CI_DB_mssql_driver extends CI_DB {
}
// Note: Escaping is required in the event that the DB name
- // contains reserved characters
- if (mssql_select_db($this->escape_identifiers($database), $this->conn_id))
+ // contains reserved characters.
+ if (mssql_select_db('['.$database.']', $this->conn_id))
{
$this->database = $database;
return TRUE;
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 7cbcf1028..a827a6ed4 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -336,9 +336,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
protected function _escape_str($str)
{
- return is_resource($this->conn_id)
- ? mysql_real_escape_string($str, $this->conn_id)
- : addslashes($str);
+ return mysql_real_escape_string($str, $this->conn_id);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 09277fc39..aa4c6b559 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -307,9 +307,7 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
protected function _escape_str($str)
{
- return is_object($this->conn_id)
- ? $this->conn_id->real_escape_string($str)
- : addslashes($str);
+ return $this->conn_id->real_escape_string($str);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php
index 1b8fbc9d4..3f3af2e19 100644
--- a/system/database/drivers/pdo/pdo_result.php
+++ b/system/database/drivers/pdo/pdo_result.php
@@ -93,7 +93,7 @@ class CI_DB_pdo_result extends CI_DB_result {
{
// Might trigger an E_WARNING due to not all subdrivers
// supporting getColumnMeta()
- $field_names[$i] = @$this->result_id->getColumnMeta();
+ $field_names[$i] = @$this->result_id->getColumnMeta($i);
$field_names[$i] = $field_names[$i]['name'];
}
diff --git a/system/database/drivers/sqlite3/sqlite3_driver.php b/system/database/drivers/sqlite3/sqlite3_driver.php
index a7d0d087d..2b447a1b3 100644
--- a/system/database/drivers/sqlite3/sqlite3_driver.php
+++ b/system/database/drivers/sqlite3/sqlite3_driver.php
@@ -189,7 +189,7 @@ class CI_DB_sqlite3_driver extends CI_DB {
*/
protected function _escape_str($str)
{
- return $this->conn_id->escapeString(remove_invisible_characters($str));
+ return $this->conn_id->escapeString($str);
}
// --------------------------------------------------------------------