]> git.joonet.de Git - adminer.git/commitdiff
Don't refer to last array element by count
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sun, 21 Jun 2009 23:56:37 +0000 (23:56 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sun, 21 Jun 2009 23:56:37 +0000 (23:56 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@741 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/sql.inc.php

index b103f7b4ece9319b32b87739478945d0b4ff7b7a..4f7d46a1fec029e437ce6c4ba21cfbd2e67a350c 100644 (file)
@@ -7,7 +7,7 @@ if (!$error && $_POST) {
                @set_time_limit(0); // set_time_limit() can be disabled
                $query = str_replace("\r", "", $query); // parser looks for \n
                $query = rtrim($query);
-               if (strlen($query) && $history[count($history)-1] != $query) { // don't add repeated 
+               if (strlen($query) && (!$history || end($history) != $query)) { // don't add repeated 
                        $history[] = $query;
                }
                $delimiter = ";";