diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-25 12:25:13 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-25 12:25:13 +0200 |
commit | e47425844e84d54c659280c04f450a3526b4e09d (patch) | |
tree | eb907b478c59801dd691dfef723b169560522cbf | |
parent | 9093042c1f56bbdce2785ec5de0cd4180b4e6216 (diff) |
Add missing delimiter in preg_quote() occurences (fix #1929)
-rw-r--r-- | system/database/DB_driver.php | 10 | ||||
-rw-r--r-- | system/database/DB_query_builder.php | 2 | ||||
-rw-r--r-- | system/helpers/url_helper.php | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 7f1434fc1..e8286aaa1 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -640,7 +640,7 @@ abstract class CI_DB_driver { // Make sure not to replace a chunk inside a string that happens to match the bind marker if ($c = preg_match_all("/'[^']*'/i", $sql, $matches)) { - $c = preg_match_all('/'.preg_quote($this->bind_marker).'/i', + $c = preg_match_all('/'.preg_quote($this->bind_marker, '/').'/i', str_replace($matches[0], str_replace($this->bind_marker, str_repeat(' ', $ml), $matches[0]), $sql, $c), @@ -652,7 +652,7 @@ abstract class CI_DB_driver { return $sql; } } - elseif (($c = preg_match_all('/'.preg_quote($this->bind_marker).'/i', $sql, $matches, PREG_OFFSET_CAPTURE)) !== $bind_count) + elseif (($c = preg_match_all('/'.preg_quote($this->bind_marker, '/').'/i', $sql, $matches, PREG_OFFSET_CAPTURE)) !== $bind_count) { return $sql; } @@ -1007,13 +1007,13 @@ 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_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[0] = $preg_ec[1] = preg_quote($this->_escape_char, '/'); $preg_ec[2] = $preg_ec[3] = $this->_escape_char; } } @@ -1172,7 +1172,7 @@ abstract class CI_DB_driver { if (empty($_operators)) { $_les = ($this->_like_escape_str !== '') - ? '\s+'.preg_quote(trim(sprintf($this->_like_escape_str, $this->_like_escape_chr))) + ? '\s+'.preg_quote(trim(sprintf($this->_like_escape_str, $this->_like_escape_chr)), '/') : ''; $_operators = array( '\s*(?:<|>|!)?=\s*', // =, <=, >=, != diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 5ea9643fe..ed00510ac 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -2077,7 +2077,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { for ($ci = 0, $cc = count($conditions); $ci < $cc; $ci++) { if (($op = $this->_get_operator($conditions[$ci])) === FALSE - OR ! preg_match('/^(\(?)(.*)('.preg_quote($op).')\s*(.*(?<!\)))?(\)?)$/i', $conditions[$ci], $matches)) + OR ! preg_match('/^(\(?)(.*)('.preg_quote($op, '/').')\s*(.*(?<!\)))?(\)?)$/i', $conditions[$ci], $matches)) { continue; } diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index de5bdec31..dc77246dc 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -489,7 +489,7 @@ if ( ! function_exists('url_title')) $separator = '_'; } - $q_separator = preg_quote($separator); + $q_separator = preg_quote($separator, '#'); $trans = array( '&.+?;' => '', |