]> git.joonet.de Git - adminer.git/commitdiff
Show only errors with file upload by default
authorJakub Vrana <jakub@vrana.cz>
Sun, 27 Mar 2011 22:56:48 +0000 (00:56 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 27 Mar 2011 22:56:48 +0000 (00:56 +0200)
adminer/sql.inc.php

index 6b5b86f9ad8542883a1a4dcfe65384565383373c..8301476981b13d683e66a10d62d80b2ff0584af5 100644 (file)
@@ -175,7 +175,10 @@ if ($_POST) {
 }
 textarea("query", $q, 20);
 echo ($_POST ? "" : "<script type='text/javascript'>document.getElementsByTagName('textarea')[0].focus();</script>\n");
-echo "<p>" . (ini_bool("file_uploads") ? lang('File upload') . ': <input type="file" name="sql_file"> (&lt; ' . ini_get("upload_max_filesize") . 'B)' : lang('File uploads are disabled.')); // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
+echo "<p>" . (ini_bool("file_uploads")
+       ? lang('File upload') . ': <input type="file" name="sql_file"' . ($_FILES && $_FILES["sql_file"]["error"] != 4 ? '' : ' onchange="this.form[\'only_errors\'].checked = true;"') . '> (&lt; ' . ini_get("upload_max_filesize") . 'B)' // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
+       : lang('File uploads are disabled.')
+);
 
 ?>
 <p>