diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-12 15:31:53 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-12 15:31:53 +0100 |
commit | e044d6c586728a28b291880dd37562f4a7551d36 (patch) | |
tree | cd309d72b20f6dbe11ae0d5ce0c7cf2168812ee7 /system/database/drivers/mysqli/mysqli_driver.php | |
parent | 4c4740ec492b30aeb47cb1829525247053e4adfe (diff) | |
parent | 802953234f0b7669333807aaa3f2318778cde187 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mysqli/mysqli_driver.php')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 846ec0340..f38b94c13 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -144,14 +144,11 @@ class CI_DB_mysqli_driver extends CI_DB { * Set client character set * * @param string - * @param string * @return bool */ - protected function _db_set_charset($charset, $collation) + protected function _db_set_charset($charset) { - return function_exists('mysqli_set_charset') - ? @mysqli_set_charset($this->conn_id, $charset) - : @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); + return @mysqli_set_charset($this->conn_id, $charset); } // -------------------------------------------------------------------- @@ -289,18 +286,7 @@ class CI_DB_mysqli_driver extends CI_DB { return $str; } - if (function_exists('mysqli_real_escape_string') && is_object($this->conn_id)) - { - $str = mysqli_real_escape_string($this->conn_id, $str); - } - elseif (function_exists('mysql_escape_string')) - { - $str = mysql_escape_string($str); - } - else - { - $str = addslashes($str); - } + $str = is_object($this->conn_id) ? mysqli_real_escape_string($this->conn_id, $str) : addslashes($str); // escape LIKE condition wildcards if ($like === TRUE) |