diff options
author | Root <development@fractureme.com> | 2012-05-26 00:52:59 +0200 |
---|---|---|
committer | Root <development@fractureme.com> | 2012-05-26 00:52:59 +0200 |
commit | 99e602d25051ed449255fe16c4aa0aadd7d05c1f (patch) | |
tree | a0a9d0cdf4e741fcff68a2ecd70c198a43b5d787 /system/database/drivers/mysql | |
parent | 35ac46d4aad12fe723229feca403b4dee3efcc27 (diff) | |
parent | f33e2ff30b0a9c54d6e8adbe88662838b9bd525e (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r-- | system/database/drivers/mysql/mysql_driver.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 161f99541..d801a9aaf 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -47,7 +47,7 @@ class CI_DB_mysql_driver extends CI_DB { // clause and character used for LIKE escape sequences - not used in MySQL protected $_like_escape_str = ''; - protected $_like_escape_chr = ''; + protected $_like_escape_chr = '\\'; /** * The syntax to count rows is slightly different across different @@ -291,7 +291,9 @@ class CI_DB_mysql_driver extends CI_DB { // escape LIKE condition wildcards if ($like === TRUE) { - return str_replace(array('%', '_'), array('\\%', '\\_'), $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; |