Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't ignore legitimate files when pasting mixed content (#38459)
Gutenberg's paste handler generally processes any files present in the clipboard data of a paste event. However, an exception was introduced in 2018 in #4882 to deal with the fact that paste objects from Microsoft Word and other Office software contain a rendered image of the copied content. Users expected the actual content to be pasted, not an image thereof. Thus, the exception consisted of ignoring any files if the clipboard also contained HTML data, favouring the latter. This exception is now leading to false positives. In certain platforms (e.g. Google Photos using Google Chrome), when users copy an image, the resulting clipboard includes fallback HTML data. With the present fix, pasted files are only ignored if the concurrent HTML data matches a distinct string signature from Microsoft Office.
- Loading branch information