Don't refer to last array element by count

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@741 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-06-21 23:56:37 +00:00
parent 53a3cd11d3
commit ffe563cbf0

View 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 = ";";