diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-20 15:39:16 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-20 15:39:16 +0100 |
commit | c082292f0678b71b8c3d323ea74f847ed4da100e (patch) | |
tree | 0fa0426f288e8f929ff50849e3c54f723ac52bcc /system/database/drivers/mysqli/mysqli_driver.php | |
parent | 56c879a870600b3e3ffce586c849d53e85f93674 (diff) | |
parent | 4d1167149a9bad94bdc6a6947525d4c610f0e3aa (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mysqli/mysqli_driver.php')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index d06119a13..4c5d52127 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * @@ -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) @@ -711,4 +697,4 @@ class CI_DB_mysqli_driver extends CI_DB { } /* End of file mysqli_driver.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_driver.php */ +/* Location: ./system/database/drivers/mysqli/mysqli_driver.php */
\ No newline at end of file |