]> git.joonet.de Git - adminer.git/commitdiff
Error in case of found string at end of chunk (thanks to simonik)
authorJakub Vrana <jakub@vrana.cz>
Mon, 29 Aug 2011 13:58:53 +0000 (15:58 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 29 Aug 2011 13:58:53 +0000 (15:58 +0200)
adminer/sql.inc.php
changes.txt

index e4d135f523dccca4712f08be531cfa9e85242796..cc98e5ec26b1101417dce0fbd67e0d985d884516 100644 (file)
@@ -73,12 +73,13 @@ if (!$error && $_POST) {
                                        if ($found && $found != $delimiter) { // find matching quote or comment end
                                                while (preg_match('(' . ($found == '/*' ? '\\*/' : ($found == '[' ? ']' : (ereg('^-- |^#', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
                                                        $s = $match[0][0];
-                                                       $offset = $match[0][1] + strlen($s);
                                                        if (!$s && $fp && !feof($fp)) {
-                                                               $offset -= strlen($found); // strlen($found) >= strlen("\\.") - 1
                                                                $query .= fread($fp, 1e5);
-                                                       } elseif ($s[0] != "\\") {
-                                                               break;
+                                                       } else {
+                                                               $offset = $match[0][1] + strlen($s);
+                                                               if ($s[0] != "\\") {
+                                                                       break;
+                                                               }
                                                        }
                                                }
                                        } else { // end of a query
index e6f24e282b61f00a94ad3caec664184f2bf72189..0c0ccb457d7a3774a7efa0e9ed38c1aab0275b54 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 3.3.4-dev:
 Foreign keys default actions (bug #3397606)
+Fix minor parser bug in SQL command with webserver file
 PostgreSQL: fix alter foreign key
 SET DEFAULT foreign key action
 PostgreSQL over PDO: connect if the eponymous database does not exist (bug #3391619)