diff options
author | Andrey Andreev <narf@bofh.bg> | 2013-01-10 10:40:09 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2013-01-10 10:40:09 +0100 |
commit | be999666179d34a2282bd46271b74364f22f3144 (patch) | |
tree | d938bd88ba223f30682ef53eaa7825756a4f8145 /system/database/drivers/mysqli/mysqli_driver.php | |
parent | 96fef156a21c7c88d4c332af03e7a74b80c2b92d (diff) |
Apply improvement proposed in #2142
Diffstat (limited to 'system/database/drivers/mysqli/mysqli_driver.php')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 966a7b1fd..be9176e16 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -214,7 +214,7 @@ class CI_DB_mysqli_driver extends CI_DB { // modifies the query so that it a proper number of affected rows is returned. if ($this->delete_hack === TRUE && preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) { - return preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/', 'DELETE FROM \\1 WHERE 1=1', $sql); + return trim($sql).' WHERE 1=1'; } return $sql; |