summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-26 11:09:28 +0200
committerAndrey Andreev <narf@bofh.bg>2012-03-26 11:09:28 +0200
commit94708bd62022f9a0cfb06d2f26e8441b6c4c562c (patch)
tree217405bbd1ad6cb90f9907e5b9486d302dfc8214 /system/database/drivers
parent8a7537a12ce0416cd59adfd16d569a452c5e6987 (diff)
Alter SQLite's escape_str() for LIKE queries
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index fa7e4846a..08b074cca 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -245,9 +245,9 @@ class CI_DB_sqlite_driver extends CI_DB {
// escape LIKE condition wildcards
if ($like === TRUE)
{
- $str = str_replace( array('%', '_', $this->_like_escape_chr),
- array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr),
- $str);
+ return str_replace(array($this->_like_escape_chr, '%', '_'),
+ array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_')
+ $str);
}
return $str;