summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-10-31 12:09:33 +0100
committerAndrey Andreev <narf@devilix.net>2016-10-31 12:10:04 +0100
commit6b5464c5b8a97268aab3814b56a1413a9463a97f (patch)
tree89ff557d6531ede9df552350caa1b0d189a97637
parent14a6c2e2925724b5bf814dc895e14535dfa0aa09 (diff)
Merge pull request #4893 from tianhe1986/develop_fix_dbdriver_quote
Fix compile_binds: do not use back references inside a character class.
-rw-r--r--system/database/DB_driver.php2
-rw-r--r--system/database/drivers/odbc/odbc_driver.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index fcc15eee5..151340596 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1000,7 +1000,7 @@ abstract class CI_DB_driver {
$ml = strlen($this->bind_marker);
// Make sure not to replace a chunk inside a string that happens to match the bind marker
- if ($c = preg_match_all("/(['\"])[^\\1]*\\1/i", $sql, $matches))
+ if ($c = preg_match_all("/'[^']*'|\"[^\"]*\"/i", $sql, $matches))
{
$c = preg_match_all('/'.preg_quote($this->bind_marker, '/').'/i',
str_replace($matches[0],
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index b5512fd76..82efa498c 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -172,7 +172,7 @@ class CI_DB_odbc_driver extends CI_DB_driver {
$ml = strlen($this->bind_marker);
// Make sure not to replace a chunk inside a string that happens to match the bind marker
- if ($c = preg_match_all("/(['\"])[^\\1]*\\1/i", $sql, $matches))
+ if ($c = preg_match_all("/'[^']*'|\"[^\"]*\"/i", $sql, $matches))
{
$c = preg_match_all('/'.preg_quote($this->bind_marker, '/').'/i',
str_replace($matches[0],