Permalink
Browse files

Error in case of found string at end of chunk (thanks to simonik)

  • Loading branch information...
1 parent c456f52 commit dd85aa5d6a782cf079d3d71d67fec9fd284de7fb @vrana committed Aug 29, 2011
Showing with 6 additions and 4 deletions.
  1. +5 −4 adminer/sql.inc.php
  2. +1 −0 changes.txt
View
@@ -73,12 +73,13 @@
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
View
@@ -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)

0 comments on commit dd85aa5

Please sign in to comment.