diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-06-08 14:39:24 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-06-08 14:39:24 +0200 |
commit | 9637b40ca9e9ac1cdce2b895d3db09848a6eef76 (patch) | |
tree | 7d042090e0aa9491b9f32649b62674a5111eb766 /system/database/drivers/mysql | |
parent | 082ee2b054b0d61ac02fea3deb704290e8d6021a (diff) |
escape_identifiers() to accept arrays as well
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r-- | system/database/drivers/mysql/mysql_forge.php | 4 | ||||
-rw-r--r-- | system/database/drivers/mysql/mysql_utility.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 7656c289c..d22454d84 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -142,7 +142,7 @@ class CI_DB_mysql_forge extends CI_DB_forge { if (count($primary_keys) > 0) { $key_name = $this->db->escape_identifiers(implode('_', $primary_keys)); - $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->protect_identifiers($primary_keys)).')'; + $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->escape_identifiers($primary_keys)).')'; } if (is_array($keys) && count($keys) > 0) @@ -152,7 +152,7 @@ class CI_DB_mysql_forge extends CI_DB_forge { if (is_array($key)) { $key_name = $this->db->escape_identifiers(implode('_', $key)); - $key = $this->db->protect_identifiers($key); + $key = $this->db->escape_identifiers($key); } else { diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 643682fde..f0bbc665e 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -65,7 +65,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Get the table schema - $query = $this->db->query('SHOW CREATE TABLE '.$this->db->protect_identifiers($this->db->database).'.'.$this->db->protect_identifiers($table)); + $query = $this->db->query('SHOW CREATE TABLE '.$this->db->escape_identifiers($this->db->database.'.'.$table)); // No result means the table name was invalid if ($query === FALSE) @@ -120,7 +120,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { TRUE); // Create a string of field names - $field_str .= $this->db->protect_identifiers($field->name).', '; + $field_str .= $this->db->escape_identifiers($field->name).', '; $i++; } |