summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysqli
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mysqli')
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index d6e967498..63df0fe6f 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -225,7 +225,19 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
function escape_str($str)
{
- return mysqli_real_escape_string($this->conn_id, $str);
+ if (get_magic_quotes_gpc())
+ {
+ return $str;
+ }
+
+ if (function_exists('mysql_escape_string'))
+ {
+ return mysqli_real_escape_string($this->conn_id, $str);
+ }
+ else
+ {
+ return addslashes($str);
+ }
}
// --------------------------------------------------------------------