Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#35008 closed defect (bug) (fixed)

Ampersands in URLs are no longer converted to entities

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: pento's profile pento
Milestone: 4.4.1 Priority: normal
Severity: normal Version: 4.4
Component: Formatting Keywords: fixed-major
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Reported by @hoveroverus on support forums.

  1. Go to Add New Post screen.
  2. Switch from TinyMCE to the Text editor.
  3. Paste this to the textarea: & <a href="http://example.com/?a=1&s=2&hl=3">test</a>.
  4. Click the Preview button.

In 4.3.1, all ampersands are converted to entities:

&#038; <a href="http://example.com/?a=1&#038;s=2&#038;hl=3">test</a>

In 4.4, the ampersands in the URL are not converted, which leads to errors reported by W3C HTML validator:

&#038; <a href="http://example.com/?a=1&s=2&hl=3">test</a>

Change History (8)

#1 @SergeyBiryukov
9 years ago

  • Description modified (diff)

#3 @peterwilsoncc
9 years ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core by jorbin. View the logs.


9 years ago

#5 @pento
9 years ago

  • Owner set to pento
  • Status changed from new to assigned

#6 @pento
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 36036:

Texturize: Transform & into &#038; in tag attributes.

[35709] was overly broad, and stopped transforming & characters within tag attributes. So that sites aren't generating invalid HTML, we need to restore this functionality, while continuing to not transform & within blocked tags.

Fixes #35008 for trunk.

#7 @pento
9 years ago

  • Keywords fixed-major added; needs-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

#8 @pento
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 36037:

Texturize: Transform & into &#038; in tag attributes.

[35709] was overly broad, and stopped transforming & characters within tag attributes. So that sites aren't generating invalid HTML, we need to restore this functionality, while continuing to not transform & within blocked tags.

Merge of [36036] to the 4.4 branch.

Fixes #35008.

Note: See TracTickets for help on using tickets.