这是indexloc提供的服务,不要输入任何密码
Skip to content

Query Tool > Query Panel > Paste > Trojan Source Warning > Text Not Pasted #5760

@pbryant-phew

Description

@pbryant-phew

Describe the bug

Since v6.17, when pasting text into the Query Tool > Query panel, if that text produces the Trojan Source Warning (TSW), none of the text on the clipboard is pasted when clicking OK on the TSW popup window. In versions up to 6.16 you could click past the TSW and the text would be pasted into the Query panel fine. Opening a file containing the same text does cause the same TSW but the text in the file opens/renders fine (hence that is the workaround, and also indicates that this clipboard-paste behaviour for the same text is unexpected).

To Reproduce

Steps to reproduce the behavior:

  1. Copy text containing something that produces the TSW into the system clipboard. I am pasting the following text which contains Unicode special characters that are not rendered by normal text editors. The special characters are the codes:

These appear either side of the كشميري‎ text below (hence the actual text below includes E'कश्मीरी<0xa0>كشميري‎<0x200e>' if you type the special characters as ASCII character, which they are not, of course).

INSERT INTO myschema.language (id, name, iso_name, native_name, language_family, "iso_639-1", "iso_639-2T", "iso_639-2B", "iso_639-3", notes, is_available) VALUES (E'kas', E'Kashmiri', E'Kashmiri', E'कश्मीरी كشميري‎', E'Indo-European', E'ks', E'kas', E'kas', E'kas', DEFAULT, DEFAULT);

  1. Paste the text into the Query Tool > Query panel
  2. The TSW warning will appear. Click OK on that warning (since this isn't trojan source text)
  3. The pasted text will not appear in the Query panel

Expected behavior

The pasted text should appear in the query panel. This is not trojan source text - it is just text containing unicode special characters which we believe are required/intended.

Error message

There are not error messages other than the TSW popup. There is nothing that appears to be a relevant log in the macOS Console app at the time coinciding with the pasting or the TSW OK button click.

Screenshots

Screenshots aren't relevant since they would only show the TSW popup (whose content is generic) and an empty Query panel after clicking OK on the TSW.

Desktop (please complete the following information):

  • OS: macOS 13.1
  • Version: 6.17-6.19 (so far)
  • Mode: Desktop
  • Browser (if running in server mode): n/a
  • Package type: macOS installer (Electron app)

Additional context

  • I am not able to find any pgAdmin 4 preference/setting that allows the user to control what happen after TSW is displayed for clipboard text (eg controlling whether the text should be pasted or not).
  • I am not able to find any documentation on the expected behaviour, or recent changes since 6.17, after the TSW has been displayed.
  • I am not able to find any other commentary through a Google search around this change from 6.16 to 6.17 (and I haven't tried to find this change in the source code).
  • Consequently, since it is new and limiting behaviour that doesn't appear to be controllable or clearly documented, it must be a bug

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions