mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added the ability to detect and warn users about bidirectional Unicode characters. Fixes #7002
This commit is contained in:
@@ -18,6 +18,7 @@ import gettext from 'sources/gettext';
|
||||
import OrigCodeMirror from 'bundled_codemirror';
|
||||
import Notifier from '../../../../../../static/js/helpers/Notifier';
|
||||
import { isMac } from '../../../../../../static/js/keyboard_shortcuts';
|
||||
import { checkTrojanSource } from '../../../../../../static/js/utils';
|
||||
|
||||
const useStyles = makeStyles(()=>({
|
||||
sql: {
|
||||
@@ -277,6 +278,8 @@ export default function Query() {
|
||||
'file_name': decodeURI(fileName),
|
||||
}).then((res)=>{
|
||||
editor.current.setValue(res.data);
|
||||
//Check the file content for Trojan Source
|
||||
checkTrojanSource(res.data);
|
||||
lastSavedText.current = res.data;
|
||||
eventBus.fireEvent(QUERY_TOOL_EVENTS.LOAD_FILE_DONE, fileName, true);
|
||||
eventBus.fireEvent(QUERY_TOOL_EVENTS.QUERY_CHANGED, isDirty());
|
||||
|
||||
Reference in New Issue
Block a user