From: Jakub Vrana Date: Mon, 30 Apr 2012 00:54:18 +0000 (-0700) Subject: Save assignment if not necessary X-Git-Tag: v3.4.0~46 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=b16bb542195fb8055e24f1ca2b173727b1261b83;p=adminer.git Save assignment if not necessary --- diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index 06a068cc..fcb07785 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -71,10 +71,10 @@ if (!$error && $_POST) { if (!$found && $fp && !feof($fp)) { $query .= fread($fp, 1e5); } else { - $offset = $pos + strlen($found); if (!$found && rtrim($query) == "") { break; } + $offset = $pos + strlen($found); if ($found && rtrim($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];