]> git.joonet.de Git - adminer.git/commitdiff
MySQL specific characters
authorJakub Vrana <jakub@vrana.cz>
Thu, 4 Aug 2011 20:58:25 +0000 (22:58 +0200)
committerJakub Vrana <jakub@vrana.cz>
Thu, 4 Aug 2011 21:18:50 +0000 (23:18 +0200)
adminer/sql.inc.php

index d739bf16293c5cd6853ad90d82547a67188c413d..090d3e5a81b5064c02a8fc9ac7fb90b1ebbcf0d1 100644 (file)
@@ -51,7 +51,7 @@ if (!$error && $_POST) {
                }
                $commands = 0;
                $errors = array();
-               $parse = '[\'`"]' . ($jush == "pgsql" ? '|\\$[^$]*\\$' : ($jush == "mssql" || $jush == "sqlite" ? '|\\[' : '')) . '|/\\*|-- |#'; //! ` and # not everywhere
+               $parse = '[\'"' . ($jush == "sql" ? '`#' : ($jush == "sqlite" ? '`[' : ($jush == "mssql" ? '[' : ''))) . ']|/\\*|-- |$' . ($jush == "pgsql" ? '|\\$[^$]*\\$' : '');
                $total_start = microtime();
                parse_str($_COOKIE["adminer_export"], $adminer_export);
                $dump_format = $adminer->dumpFormat();
@@ -61,7 +61,7 @@ if (!$error && $_POST) {
                                $delimiter = $match[1];
                                $query = substr($query, strlen($match[0]));
                        } else {
-                               preg_match('(' . preg_quote($delimiter) . "|$parse|\$)", $query, $match, PREG_OFFSET_CAPTURE, $offset); // should always match
+                               preg_match('(' . preg_quote($delimiter) . "|$parse)", $query, $match, PREG_OFFSET_CAPTURE, $offset); // should always match
                                $found = $match[0][0];
                                $offset = $match[0][1] + strlen($found);
                                if (!$found && $fp && !feof($fp)) {