From 67242862c4ee29bae5ad73516eeb5c2a6610eb5d Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Mon, 12 Oct 2020 18:01:53 +0530 Subject: [PATCH] Fixed an issue where extensions are getting added multiple times when the user uses the "Save As" option. refs #4855 --- web/pgadmin/misc/file_manager/static/js/create_dialogue.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js index c7e4b6b60..634742a0d 100644 --- a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js +++ b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js @@ -151,7 +151,9 @@ module.exports = Alertify.dialog('createModeDlg', function() { there is a . already but it's not following the last /, AND the extension isn't *, then we add the extension. */ - if (ext != '*') { + if ((!newFile.includes('.') || + newFile.split('.').pop() != ext) && + ext != '*') { newFile = newFile + '.' + ext; $('.storage_dialog #uploader .input-path').val(newFile); }