From 6b5464c5b8a97268aab3814b56a1413a9463a97f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 31 Oct 2016 13:09:33 +0200 Subject: Merge pull request #4893 from tianhe1986/develop_fix_dbdriver_quote Fix compile_binds: do not use back references inside a character class. --- system/database/DB_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_driver.php') 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], -- cgit v1.2.3-24-g4f1b