Make WordPress Core

Opened 14 months ago

Last modified 14 months ago

#39543 new defect (bug)

Certain Strings When Pasted Into Title Bar Cause Loss of Styling

Reported by: Tranny Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: General Keywords: reporter-feedback
Focuses: Cc:


To reproduce:

1 - open startpage.com or similar search engine that doesn't use URL redirects
2 - search for string that contains special characters, for example: "Nova Fátima (Paraná)"
3 - highlight "Nova Fátima (Paraná)" from the top result (https://pt.wikipedia.org/wiki/Nova_F%C3%A1tima_(Paran%C3%A1)) and copy it to clipboard
4 - on /wp-admin/post-new.php paste the content of your clipboard to where t says "Enter title here"
5 - ta da

Change History (2)

#1 @SergeyBiryukov
14 months ago

  • Keywords reporter-feedback added

Hi @Tranny, thanks for the ticket!

I could not reproduce the issue on a clean install, both the string and the URL are correctly saved as a post title.

Does it still happen with all plugins disabled and a default theme (Twenty Seventeen or Twenty Sixteen) activated?

Last edited 14 months ago by SergeyBiryukov (previous) (diff)

#2 @Tranny
14 months ago


I tried it on two different WP installations, which are each hosted on different servers with different companies. Both use TwentySixteen default theme, and while both have some plugins activated, each has different plugins, and not many of them (no exotic plugins installed).

I noticed that this only happens when a hyperlinked text is copy-pasted into the title bar. I'm on a Windows computer, and when I highlight a hyperlinked text (such as a clickable search result), the text gets copied along with the link it is associated with. So if I subsequently go to an advanced text editor (such as Microsoft Word) and paste it there, it will be pasted in the document as hyperlinked text.

Pasting text that's been copied along with the embedded hyperlink is when it breaks the styling. But if I copy the hyperlinked text, paste it in some basic text editor (such as Notepad), which only deals with plain text, then the hyperlink is stripped, so if I highlight the text again, and copy if off Notepad again (ie now the copied text is plain text string, so it won't paste as hyperlinked into Microsoft Word), styling doesn't get broken, and everything works fine.

So to reproduce, make sure you copy a hyperlinked text, and test it on something like Microsoft Word to make sure it is copied hyperlinked. Also, I noticed that it's only some hyperlinks that break it, not all. For example an English language Wikipedia page doesn't break it.But the Portuguese one does.

Last edited 14 months ago by Tranny (previous) (diff)
Note: See TracTickets for help on using tickets.