summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/SqlFormatter.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/SqlFormatter.php b/lib/SqlFormatter.php
index a2d7399..44e6143 100644
--- a/lib/SqlFormatter.php
+++ b/lib/SqlFormatter.php
@@ -172,7 +172,7 @@ class SqlFormatter
// 1. backtick quoted string using `` to escape
// 2. double quoted string using "" or \" to escape
// 3. single quoted string using '' or \' to escape
- if( preg_match('/^((`(?:[^`]|``)*($|`))|("((?:[^"\\\\]|"")|(?:[^"\\\\]|\\\\.))*($|"))|(\'((?:[^\'\\\\]|\'\')|(?:[^\'\\\\]|\\\\.))*($|\')))/', $string, $matches)) {
+ if( preg_match('/^(((`[^`]*($|`))+)|(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)|((\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*(\'|$))+))/s', $string, $matches)) {
if($string[0]==='`') {
return array(
self::TOKEN_VALUE=>$matches[1],