diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-02 13:58:54 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-02 13:58:54 +0200 |
commit | d66872ae5d7cd4d2b531251a9c63528e81af3322 (patch) | |
tree | 4ed76ac11914b22e2aa9d43f65db6f27b1b7bd7a /system/database/DB_driver.php | |
parent | f00b9f02425afc902d79209c108ae74ab73342c9 (diff) | |
parent | fac3761c6a01a12457c61cd4e3b17dba5ee26bf7 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/db_subdrivers
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 295b109f7..877147c5f 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -971,6 +971,11 @@ abstract class CI_DB_driver { return $item; } + // Avoid breaking functions inside queries + elseif (strpos($item, '(') !== FALSE) + { + return $item; + } static $preg_ec = array(); @@ -978,11 +983,15 @@ abstract class CI_DB_driver { { if (is_array($this->_escape_char)) { - $preg_ec = array(preg_quote($this->_escape_char[0]), preg_quote($this->_escape_char[1])); + $preg_ec = array( + preg_quote($this->_escape_char[0]), preg_quote($this->_escape_char[1]), + $this->_escape_char[0], $this->_escape_char[1] + ); } else { $preg_ec[0] = $preg_ec[1] = preg_quote($this->_escape_char); + $preg_ec[2] = $preg_ec[3] = $this->_escape_char; } } @@ -990,11 +999,11 @@ abstract class CI_DB_driver { { if (strpos($item, '.'.$id) !== FALSE) { - return preg_replace('/'.$preg_ec[0].'?([^'.$preg_ec[1].'\.]+)'.$preg_ec[1].'?\./i', $preg_ec[0].'$1'.$preg_ec[1].'.', $item); + return preg_replace('/'.$preg_ec[0].'?([^'.$preg_ec[1].'\.]+)'.$preg_ec[1].'?\./i', $preg_ec[2].'$1'.$preg_ec[3].'.', $item); } } - return preg_replace('/'.$preg_ec[0].'?([^'.$preg_ec[1].'\.]+)'.$preg_ec[1].'?(\.)?/i', $preg_ec[0].'$1'.$preg_ec[1].'$2', $item); + return preg_replace('/'.$preg_ec[0].'?([^'.$preg_ec[1].'\.]+)'.$preg_ec[1].'?(\.)?/i', $preg_ec[2].'$1'.$preg_ec[3].'$2', $item); } // -------------------------------------------------------------------- |