Editor: Avoid trailing dot in export filename

Context: https://sourceforge.net/p/adminer/discussion/960418/thread/ca36ed7b66/
This commit is contained in:
Jakub Vrana 2021-02-07 16:40:29 +01:00
parent d847f0d1aa
commit 4559e7541c
2 changed files with 2 additions and 1 deletions

View file

@ -1115,7 +1115,7 @@ function dump_headers($identifier, $multi_table = false) {
$return = $adminer->dumpHeaders($identifier, $multi_table);
$output = $_POST["output"];
if ($output != "text") {
header("Content-Disposition: attachment; filename=" . $adminer->dumpFilename($identifier) . ".$return" . ($output != "file" && !preg_match('~[^0-9a-z]~', $output) ? ".$output" : ""));
header("Content-Disposition: attachment; filename=" . $adminer->dumpFilename($identifier) . ".$return" . ($output != "file" && preg_match('~^[0-9a-z]+$~', $output) ? ".$output" : ""));
}
session_write_close();
ob_flush();

View file

@ -21,6 +21,7 @@ MS SQL: Don't truncate comments to 30 chars (PR #376)
Elasticsearch 6: Fix displaying type mapping (PR #402)
MongoDB: Fix password-less check in the mongo extension (PR #405)
Editor: Cast to string when searching (bug #325)
Editor: Avoid trailing dot in export filename
Re-enable PHP warnings (regression from 4.7.8)
Adminer 4.7.8 (released 2020-12-06):