diff options
author | Derek Jones <derek.jones@ellislab.com> | 2009-02-20 22:44:59 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2009-02-20 22:44:59 +0100 |
commit | e4ed583067095144eb20aefc61d4499d8386532a (patch) | |
tree | b156a0305e5c1e84466bcb0ca84787b234be3cfd /system/database/DB_active_rec.php | |
parent | 436e6e2583c574a4628984c4a95c5d3da5fcce1f (diff) |
added LIKE condition escaping to all drivers and Active Record
updated all DB drivers to accept arrays in escape_str()
Diffstat (limited to 'system/database/DB_active_rec.php')
-rw-r--r-- | system/database/DB_active_rec.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index c757e6ae6..d48f43e51 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -707,7 +707,7 @@ class CI_DB_active_record extends CI_DB_driver { $prefix = (count($this->ar_like) == 0) ? '' : $type; - $v = $this->escape_str($v); + $v = $this->escape_like_str($v); if ($side == 'before') { @@ -722,6 +722,12 @@ class CI_DB_active_record extends CI_DB_driver { $like_statement = $prefix." $k $not LIKE '%{$v}%'"; } + // some platforms require an escape sequence definition for LIKE wildcards + if ($this->_like_escape_str != '') + { + $like_statement = $like_statement.sprintf($this->_like_escape_str, $this->_like_escape_char); + } + $this->ar_like[] = $like_statement; if ($this->ar_caching === TRUE) { |