(content, isPasteEvent)
| 380 | } |
| 381 | |
| 382 | export function checkTrojanSource(content, isPasteEvent) { |
| 383 | // Call the hasTrojanSource function of 'anti-trojan-source' package |
| 384 | if (hasTrojanSource({ sourceText: content})) { |
| 385 | let msg = gettext('The file opened contains bidirectional Unicode characters which could be interpreted differently than what is displayed. If this is unexpected it is recommended that you review the text in an application that can display hidden Unicode characters before proceeding.'); |
| 386 | if (isPasteEvent) { |
| 387 | msg = gettext('The pasted text contains bidirectional Unicode characters which could be interpreted differently than what is displayed. If this is unexpected it is recommended that you review the text in an application that can display hidden Unicode characters before proceeding.'); |
| 388 | } |
| 389 | pgAdmin.Browser.notifier.alert(gettext('Trojan Source Warning'), msg); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | export function toPrettySize(rawSize, from='B', decimalFixed=null) { |
| 394 | try { |
no test coverage detected