summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-02-11 04:54:42 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-02-11 04:54:42 +0100
commit70529a739dd0a73fc72124720390313d8a8b0dca (patch)
treea6f21db8302f2da27f4cd661936c584bbaeb698c /system/database
parent58626b35b0b272c5e37a7a22c3efb68145dab14a (diff)
driver escape_table fixes
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/mssql/mssql_driver.php4
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php4
-rw-r--r--system/database/drivers/oci8/oci8_driver.php4
-rw-r--r--system/database/drivers/odbc/odbc_driver.php4
-rw-r--r--system/database/drivers/postgre/postgre_driver.php4
5 files changed, 10 insertions, 10 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index e429d21a6..8e12a2d21 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -408,9 +408,9 @@ class CI_DB_mssql_driver extends CI_DB {
// I don't believe this is necessary with MS SQL. Not sure, though. - Rick
/*
- if (strpos($table, '.') !== FALSE)
+ if (stristr($table, '.'))
{
- $table = str_replace('.', '`.`', $table);
+ $table = preg_replace("/\./", "`.`", $table);
}
*/
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 61848a674..31c27117c 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -410,9 +410,9 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
function _escape_table($table)
{
- if (strpos($table, '.') !== FALSE)
+ if (stristr($table, '.'))
{
- $table = str_replace('.', '`.`', $table);
+ $table = preg_replace("/\./", "`.`", $table);
}
return $table;
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 33fe08725..8f63c25a5 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -521,9 +521,9 @@ class CI_DB_oci8_driver extends CI_DB {
*/
function _escape_table($table)
{
- if (strpos($table, '.') !== FALSE)
+ if (stristr($table, '.'))
{
- $table = str_replace('.', '`.`', $table);
+ $table = preg_replace("/\./", "`.`", $table);
}
return $table;
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index c949a4670..dd10fbdd3 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -386,9 +386,9 @@ class CI_DB_odbc_driver extends CI_DB {
*/
function _escape_table($table)
{
- if (strpos($table, '.') !== FALSE)
+ if (stristr($table, '.'))
{
- $table = str_replace('.', '`.`', $table);
+ $table = preg_replace("/\./", "`.`", $table);
}
return $table;
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 2472c5e92..a32c37ed8 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -406,9 +406,9 @@ class CI_DB_postgre_driver extends CI_DB {
*/
function _escape_table($table)
{
- if (strpos($table, '.') !== FALSE)
+ if (stristr($table, '.'))
{
- $table = str_replace('.', '`.`', $table);
+ $table = '"'.preg_replace("/\./", '"."', $table).'"';
}
return $table;