summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysqli/mysqli_driver.php
diff options
context:
space:
mode:
authorMike Funk <mfunk@xulonpress.com>2012-03-12 14:44:42 +0100
committerMike Funk <mfunk@xulonpress.com>2012-03-12 14:44:42 +0100
commit306f56c1bfdafd149b1059325a687ec1a185d00f (patch)
tree62e2261c3b429153b9e62f3f676d7de6c18a6bfb /system/database/drivers/mysqli/mysqli_driver.php
parentdb70d047a6ac256eb336a2b04385aa010d6cbf42 (diff)
parentb3442a165a091c552a3331ece94297d5fe316fee (diff)
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into feature/all_flashdata
Diffstat (limited to 'system/database/drivers/mysqli/mysqli_driver.php')
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php19
1 files changed, 3 insertions, 16 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index d06119a13..e84b8346d 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
*
@@ -149,9 +149,7 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
protected function _db_set_charset($charset, $collation)
{
- 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 +287,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)