Browse Source

Warn about exceeded max_file_uploads in import

pull/1115/head
Jakub Vrana 2 months ago
parent
commit
146d3539d8
  1. 1
      CHANGELOG.md
  2. 1
      adminer/lang/cs.inc.php
  3. 1
      adminer/lang/xx.inc.php
  4. 5
      adminer/sql.inc.php
  5. 11
      adminer/static/editing.js

1
CHANGELOG.md

@ -1,5 +1,6 @@
## Adminer dev
- Allow specifying operator in search anywhere
- Warn about exceeded max_file_uploads in import
- MySQL 5.0-: Do not load partitioning info in alter table (bug #1099)
- PostgreSQL: Show structure of inherited tables
- PostgreSQL: Hide only partitions, not all inherited tables from menu

1
adminer/lang/cs.inc.php

@ -76,6 +76,7 @@ Lang::$translations = array(
'Webserver file %s' => 'Soubor %s na webovém serveru',
'Run file' => 'Spustit soubor',
'File does not exist.' => 'Soubor neexistuje.',
'Increase %s.' => 'Zvyšte %s.',
'File uploads are disabled.' => 'Nahrávání souborů není povoleno.',
'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.',
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',

1
adminer/lang/xx.inc.php

@ -77,6 +77,7 @@ Lang::$translations = array(
'Webserver file %s' => 'Xx %s',
'Run file' => 'Xx',
'File does not exist.' => 'Xx.',
'Increase %s.' => 'Xx %s.',
'File uploads are disabled.' => 'Xx.',
'Unable to upload a file.' => 'Xx.',
'Maximum allowed file size is %sB.' => 'Xx %sB.',

5
adminer/sql.inc.php

@ -250,8 +250,11 @@ if (!isset($_GET["import"])) {
} else {
echo "<fieldset><legend>" . lang('File upload') . "</legend><div>";
$gz = (extension_loaded("zlib") ? "[.gz]" : "");
$max_file_uploads = "max_file_uploads";
$max_file_uploads_value = ini_get($max_file_uploads);
echo (ini_bool("file_uploads")
? "SQL$gz (&lt; " . ini_get("upload_max_filesize") . "B): <input type='file' name='sql_file[]' multiple>\n$execute" // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
? "SQL$gz (&lt; " . ini_get("upload_max_filesize") . "B): <input type='file' name='sql_file[]' multiple>\n" // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
. script("qsl('input').onchange = partialArg(fileChange, $max_file_uploads_value, '" . lang('Increase %s.', "$max_file_uploads = $max_file_uploads_value") . "')") . $execute
: lang('File uploads are disabled.')
);
echo "</div></fieldset>\n";

11
adminer/static/editing.js

@ -665,6 +665,17 @@ function sqlSubmit(form, root) {
}
}
/** Check if PHP can handle the uploaded files
* @param number
* @param string
* @param Event
*/
function fileChange(event, maxFileUploads, message) {
if (event.target.files.length > maxFileUploads) {
alert(message);
}
}
/** Handle changing trigger time or event

Loading…
Cancel
Save