]> git.joonet.de Git - adminer.git/commitdiff
Save assignment if not necessary
authorJakub Vrana <jakub@vrana.cz>
Mon, 30 Apr 2012 00:54:18 +0000 (17:54 -0700)
committerJakub Vrana <jakub@vrana.cz>
Mon, 30 Apr 2012 00:54:18 +0000 (17:54 -0700)
adminer/sql.inc.php

index 06a068ccee28b2d3c506cb5205ce7f251abd221a..fcb07785fa4c343dd335fa64cf451fd3cf8188f6 100644 (file)
@@ -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];