Ensure that pgAdmin should not allow opening external files that are dragged into it. Fixes #6355

This commit is contained in:
Pradip Parkale 2021-04-28 11:59:45 +05:30 committed by Akshay Joshi
parent 718ac02806
commit 9dd1bae3c7
3 changed files with 21 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Bug fixes
| `Issue #6329 <https://redmine.postgresql.org/issues/6329>`_ - Fixed an issue where the wrong SQL is showing for the child partition tables.
| `Issue #6341 <https://redmine.postgresql.org/issues/6341>`_ - Fixed an issue where CSV download quotes the numeric columns.
| `Issue #6355 <https://redmine.postgresql.org/issues/6355>`_ - Ensure that pgAdmin should not allow opening external files that are dragged into it.
| `Issue #6377 <https://redmine.postgresql.org/issues/6377>`_ - Fixed an issue where schema diff does not create DROP DEFAULT statement for columns.
| `Issue #6385 <https://redmine.postgresql.org/issues/6385>`_ - Ensure that Backup and Restore should work on shared servers.
| `Issue #6408 <https://redmine.postgresql.org/issues/6408>`_ - Fixed ModuleNotFoundError when running setup.py from outside of the root.

View File

@ -97,6 +97,16 @@ define(
that.onCreate.apply(that, [myPanel, $container]);
}
// Prevent browser from opening the drag file.
$('.pg-panel-content').bind('dragover', function (event) {
event.stopPropagation();
event.preventDefault();
});
$('.pg-panel-content').bind('drop', function (event) {
event.stopPropagation();
event.preventDefault();
});
if (that.elContainer) {
myPanel.pgElContainer = $container;
$container.addClass('pg-el-container');

View File

@ -491,6 +491,16 @@ define('tools.querytool', [
}, 200);
});
// Prevent browser from opening the drag file.
$('#datagrid').bind('dragover', function (event) {
event.stopPropagation();
event.preventDefault();
});
$('#datagrid').bind('drop', function (event) {
event.stopPropagation();
event.preventDefault();
});
var open_new_tab = self.browser_preferences.new_browser_tab_open;
if (_.isNull(open_new_tab) || _.isUndefined(open_new_tab) || !open_new_tab.includes('qt')) {
// Listen on the panel closed event and notify user to save modifications.