summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-01-18 19:13:13 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-01-18 19:13:13 +0100
commit4a9cb96df665485c1f5d0d98cd4723d4e2f45ce8 (patch)
treeb957fb4a7bcdcd628771cf1c4ef713eb9947ff79
parent8435771a6f831fece5d4267e97c5e9c361dcb70b (diff)
Fixed the bugfix for #3260!
-rw-r--r--system/database/drivers/mysql/mysql_utility.php18
-rw-r--r--system/database/drivers/mysqli/mysqli_utility.php20
2 files changed, 19 insertions, 19 deletions
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index 3c5b94013..220af866d 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -169,15 +169,6 @@ class CI_DB_mysql_utility extends CI_DB_utility {
$i = 0;
foreach ($row as $v)
{
- // Do a little formatting...
- $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v);
- $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v);
- $v = str_replace('\\', '\\\\', $v);
- $v = str_replace('\'', '\\\'', $v);
- $v = str_replace('\\\n', '\n', $v);
- $v = str_replace('\\\r', '\r', $v);
- $v = str_replace('\\\t', '\t', $v);
-
// Is the value NULL?
if ($v === NULL)
{
@@ -185,6 +176,15 @@ class CI_DB_mysql_utility extends CI_DB_utility {
}
else
{
+ // Do a little formatting...
+ $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v);
+ $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v);
+ $v = str_replace('\\', '\\\\', $v);
+ $v = str_replace('\'', '\\\'', $v);
+ $v = str_replace('\\\n', '\n', $v);
+ $v = str_replace('\\\r', '\r', $v);
+ $v = str_replace('\\\t', '\t', $v);
+
// Escape the data if it's not an integer
if ($is_int[$i] == FALSE)
{
diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php
index 3c9094611..869e26f52 100644
--- a/system/database/drivers/mysqli/mysqli_utility.php
+++ b/system/database/drivers/mysqli/mysqli_utility.php
@@ -170,15 +170,6 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
$i = 0;
foreach ($row as $v)
{
- // Do a little formatting...
- $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v);
- $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v);
- $v = str_replace('\\', '\\\\', $v);
- $v = str_replace('\'', '\\\'', $v);
- $v = str_replace('\\\n', '\n', $v);
- $v = str_replace('\\\r', '\r', $v);
- $v = str_replace('\\\t', '\t', $v);
-
// Is the value NULL?
if ($v === NULL)
{
@@ -186,6 +177,15 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
}
else
{
+ // Do a little formatting...
+ $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v);
+ $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v);
+ $v = str_replace('\\', '\\\\', $v);
+ $v = str_replace('\'', '\\\'', $v);
+ $v = str_replace('\\\n', '\n', $v);
+ $v = str_replace('\\\r', '\r', $v);
+ $v = str_replace('\\\t', '\t', $v);
+
// Escape the data if it's not an integer
if ($is_int[$i] == FALSE)
{
@@ -195,7 +195,7 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
{
$val_str .= $v;
}
- }
+ }
// Append a comma
$val_str .= ', ';