Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#32376 closed defect (bug) (fixed)

Urls are encoded incorrectly in WP_Posts_List_Table::get_views()

Reported by: BdN3504 Owned by: wonderboymusic
Priority: normal Milestone: 4.4
Component: Posts, Post Types Version: 4.2.2
Severity: normal Keywords: has-patch needs-docs
Cc: Focuses: administration

Description

I stumbled upon this bug when I tried to fix something else: The current css class is not added to the 'All' link in the views. To solve this issue, I added the css class with DOMDocument. But when I called the method to read the html of

$views['all']

like so:

DOMDocument::loadHTML($views['all'])

, I received a parsing error. The parsing error is thrown because the ampersand in WP_Posts_List_Table::get_views() on line 185 is not encoded.
I will refrain from using my DOMDocument method of fixing the other bug, I will file another bug instead, because I now know why the 'current' css class is not added to the 'All' view.

Attachments (2)

class-wp-posts-list-table.patch​ (703 bytes ) - added by BdN3504 12 years ago.
A patch fixing the issue.
32376.diff​ (7.1 KB ) - added by wonderboymusic 11 years ago.

Download all attachments as: .zip

Change History (7)

#1 @BdN3504
12 years ago

  • Keywords has-patch added

#2 @wonderboymusic
11 years ago

  • Milestone Awaiting Review → 4.4
  • Owner set to wonderboymusic
  • Status new → assigned

I did some work here. See 32376.diff​

#3 @wonderboymusic
11 years ago

  • Resolution → fixed
  • Status assigned → closed

In 34084:

WP_Posts_List_Table: there are a cadre of edit.php URLs that are generated by string-building instead of using our handy functions. Create a helper method, ->get_edit_link() that standardizes the generation and escaping of these URLs.

Props BdN3504 for the initial patch on the ticket.
Fixes #32376.

#4 @DrewAPicture
11 years ago

  • Keywords needs-docs added
  • Resolution fixed
  • Status closed → reopened

Documentation for this new method is incomplete:

  • Need docs for all three parameters, including marking the third one optional
  • The summary needs a period and should not contain markdown backticks
  • Needs an @access tag

#5 @SergeyBiryukov
11 years ago

  • Resolution → fixed
  • Status reopened → closed

In 34238:

Docs: Expand the DocBlock for the WP_Theme::get_edit_link() method, introduced in [34084].

Fixes #32376.

Note: See TracTickets for help on using tickets.