Make WordPress Core

Opened 22 months ago

Last modified 21 months ago

#49044 reviewing defect (bug)

Links in the text widget now require quotes

Reported by: spherman Owned by: audrasjb
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3.1
Component: Widgets Keywords: needs-patch
Focuses: Cc:


Up until this release, if I had a link a text widget like this it would work.

<a href=/wp-content/uploads/lockport-new-patient-form.pdf target=_blank>New Patient Packet</a>

the recent updated made the same link format like this when you click on it:

I had to go in and change the text to this in order to make it work.

<a href="/wp-content/uploads/lockport-new-patient-form.pdf" target=_blank>New Patient Packet</a>

I manage over 200 sites. I have easy way of finding every link in every widget on all the sites I manage. Please fix the text widget to accept links without quotes like it used to.

Change History (6)

#1 @SergeyBiryukov
22 months ago

  • Focuses coding-standards removed
  • Summary changed from Links int he text widget now require quotes to Links in the text widget now require quotes

#2 @audrasjb
21 months ago

  • Owner set to audrasjb
  • Severity changed from critical to normal
  • Status changed from new to reviewing

Hi @spherman ,

Could you please try to add the following bit of code to your theme (or child theme) functions.php file to see if it solves the issue?


#3 @spherman
21 months ago

Thanks for responding. Your fix did not work.

Here is some additional information I noticed.

It seems that the only links that are affected are those that have target=_blank in the URL.


This does not work
<a href=/wp-content/uploads/lockport-new-patient-form.pdf target=_blank>New Patient Packet</a>

This works (but clearly would not open in a new window:
<a href=/wp-content/uploads/lockport-new-patient-form.pdf>New Patient Packet</a>

This works
<a href="/wp-content/uploads/lockport-new-patient-form.pdf" target=_blank>New Patient Packet</a>

This works
<a href="/wp-content/uploads/lockport-new-patient-form.pdf" target="_blank">New Patient Packet</a>

This is not really urgent to me as I took a couple hours and went through all my sites and fixed the links so that they would work, but I bet there are lots of people out there who are affected by this and do not know it.

Last edited 21 months ago by spherman (previous) (diff)

#4 @spherman
21 months ago

I edited my comment. This is just a note to say that you should read the message I posted and not ignore it. It came through email to me with just a portion of it that makes it seem like the issue is not fixed or is not important.

#5 @audrasjb
21 months ago

Yes, the issue is related to target blank links only. This is why I asked you to test to remove the target blank filter using wp_remove_targeted_link_rel_filters() in your theme. I will test that on my side to see if it works or not.

As it, I'm not sure we want to remove the filters used on links with target blank attribute to support links that doesn't use quotes (as I believe using quotes on attributes feels pretty standard today).

#6 @spherman
21 months ago

I agree that using quotes is pretty standard today, but I am guessing that there are a lot of sites out there with this issue that don't even know it. I only found it because one of my customers complained. It worked one day and then it did not work the next.

Updates should enhance a user's experience, not break their sites.

As I mentioned, I fixed all my sites already, but I am happy to work with you to see if we can fix the problem so that others can benefit from it.

Note: See TracTickets for help on using tickets.