summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-09-27 22:42:42 +0200
committeradmin <devnull@localhost>2006-09-27 22:42:42 +0200
commit17a890df20b56c8d82812f365f27bc590be009f3 (patch)
tree15ec4f0afb68f774e0933fb27c27346ae262d060 /system/database/drivers/mysql
parentdcafe89f348697d273e21a2d451a99ba8c6ec68f (diff)
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index b6c4eb7ea..d4f322d5f 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -222,7 +222,19 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function escape_str($str)
{
- return mysql_real_escape_string($str);
+ if (get_magic_quotes_gpc())
+ {
+ return $str;
+ }
+
+ if (function_exists('mysql_escape_string'))
+ {
+ return mysql_real_escape_string($str);
+ }
+ else
+ {
+ return addslashes($str);
+ }
}
// --------------------------------------------------------------------