]> git.joonet.de Git - adminer.git/commitdiff
Optimize parser
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 16 Jun 2009 10:31:09 +0000 (10:31 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 16 Jun 2009 10:31:09 +0000 (10:31 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@710 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/sql.inc.php

index cd4efe826d5e68f85f00819b06702a33c941eaf8..50dd417ce61e2705121c1219c3a952e172df533d 100644 (file)
@@ -6,6 +6,7 @@ if (!$error && $_POST) {
        if (is_string($query = (isset($_POST["file"]) ? get_file("sql_file") : $_POST["query"]))) {
                @set_time_limit(0);
                $query = str_replace("\r", "", $query);
+               $query = rtrim($query);
                if (strlen($query) && $history[count($history) - 1] != $query) {
                        $history[] = $query;
                }
@@ -17,7 +18,7 @@ if (!$error && $_POST) {
                if (is_object($dbh2)) {
                        $dbh2->select_db($_GET["db"]);
                }
-               while (rtrim($query)) {
+               while (strlen($query)) {
                        if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
                                $delimiter = $match[1];
                                $query = substr($query, strlen($match[0]));