Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#28356 closed defect (bug) (fixed)

wp_widget_rss_output() cleanup

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.9
Component: Widgets Keywords: has-patch commit
Focuses: Cc:

Description

There are some issues in wp_widget_rss_output():

  • […] is never appended to $summary since [27691] (see lines 876 and 881).
  • wp_html_excerpt() can cut a string in a middle of a word. wp_trim_words() should be used instead, which would make some of the other string manipulations here redundant.
  • $title is escaped with esc_attr(), but never used as an attribute. esc_html() should be used instead.

Attachments (1)

28356.patch (1.7 KB) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
10 years ago

28356.patch fixes these issues and also includes UmeshSingla's 26552.patch:ticket:26552.

#2 @SergeyBiryukov
10 years ago

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

In 28586:

Clean up wp_widget_rss_output():

  • Fix appending […] to $summary.
  • Use wp_trim_words() instead of wp_html_excerpt().
  • Trim $title before checking if it's empty. props UmeshSingla.
  • Use correct escaping function for $title.

fixes #28356.

Note: See TracTickets for help on using tickets.