Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#19803 closed defect (bug) (fixed)

get_previous_posts_link: Capital HTML entity

Reported by: ounziw's profile ounziw Owned by: duck_'s profile duck_
Milestone: 3.4 Priority: normal
Severity: minor Version: 3.3.1
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description (last modified by scribu)

get_previous_posts_link (located in wp-includes/link-template.php ) has a regular expression at line 1569

preg_replace( '/&([^#])(?![a-z]{1,8};)/', '&$1', $label )

This replaces ⇐ into ⇐, hence ⇐ is not allowed as a linktext. (html entites with capital letter(s) disallowed)

get_next_posts_link (also located in wp-includes/link-template.php ) has a regular expression at line 1498

preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label)

This does not replace ⇐

I propose to use

preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label)

both get_next_posts_link and get_previous_posts_link

Attachments (1)

19803.patch (618 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (4)

#1 @scribu
12 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
12 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.4

Looks like this was missed in [13922]. I guess it would make sense to be consistent.

#3 @duck_
12 years ago

  • Owner set to duck_
  • Resolution set to fixed
  • Status changed from new to closed

In [20537]:

Handle uppercase HTML entities in get_previous_posts_link(). Props ounziw. See #4152, fixes #19803.

Note: See TracTickets for help on using tickets.