From 4559e7541c2ec40f571d7b97eced962f7c6935cd Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 7 Feb 2021 16:40:29 +0100 Subject: [PATCH] Editor: Avoid trailing dot in export filename Context: https://sourceforge.net/p/adminer/discussion/960418/thread/ca36ed7b66/ --- adminer/include/functions.inc.php | 2 +- changes.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0dc2a8fa..2f681b1f 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -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(); diff --git a/changes.txt b/changes.txt index 61658cf0..3892e879 100644 --- a/changes.txt +++ b/changes.txt @@ -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):