summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-20 13:23:10 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-20 13:23:10 +0100
commitfd70ceb017b13db3faf54fa43df850c1b82abedb (patch)
tree55c547a55b349e83db32a357a48040769027fd32 /system/database/drivers/mysql/mysql_driver.php
parent5f2214f0526b823c92f308312d883147a4c9faed (diff)
parent55201acd0692f02eb5927f412db73b925b6ba738 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mysql/mysql_driver.php')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php22
1 files changed, 4 insertions, 18 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index cd1763751..ba646d226 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_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_mysql_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('mysql_set_charset')
- ? @mysql_set_charset($charset, $this->conn_id)
- : @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id);
+ return @mysql_set_charset($charset, $this->conn_id);
}
// --------------------------------------------------------------------
@@ -289,18 +286,7 @@ class CI_DB_mysql_driver extends CI_DB {
return $str;
}
- if (function_exists('mysql_real_escape_string') && is_resource($this->conn_id))
- {
- $str = mysql_real_escape_string($str, $this->conn_id);
- }
- elseif (function_exists('mysql_escape_string'))
- {
- $str = mysql_escape_string($str);
- }
- else
- {
- $str = addslashes($str);
- }
+ $str = is_resource($this->conn_id) ? mysql_real_escape_string($str, $this->conn_id) : addslashes($str);
// escape LIKE condition wildcards
if ($like === TRUE)