WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#4671 closed defect (bug) (fixed)

Empty ul in RSS widget when only a title present

Reported by: brettz95 Owned by: westi
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2.1
Component: General Keywords: has-patch dev-reviewed
Focuses: Cc:

Description

An empty <ul> element is created (and this is not XHTML kosher) when the RSS widget is used and there is only a title present (no items). The patch does a test to see if the array containing $rss->items is empty before adding <ul> tags. Didn't see a version number for this, but I assume its 2.3 as I just downloaded it...

Attachments (2)

widgetpatch.patch (2.3 KB) - added by brettz95 7 years ago.
Fix empty <ul> issue in widget.php
4671.diff (1.1 KB) - added by Nazgul 7 years ago.

Download all attachments as: .zip

Change History (6)

brettz957 years ago

Fix empty <ul> issue in widget.php

comment:1 Nazgul7 years ago

  • Component changed from Administration to General
  • Keywords has-patch added
  • Milestone set to 2.3 (trunk)
  • Version changed from 2.3 to 2.2.1

2.3 has not yet been released, so I assume you're running 2.2.1, the latest stable release.

Patch looks good. 2 small suggestions though:

  • You're mixing print and echo. I'd prefer only echo as thats the standard throughout the codebase.
  • You could combine the exisiting is_array and new is_empty into a single if statement. This would result in a smaller and cleaner patch.

Nazgul7 years ago

comment:2 Nazgul7 years ago

Cleaner patch imho.

comment:3 westi7 years ago

  • Keywords dev-reviewed added
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

+1 to Nazguls patch

comment:4 westi7 years ago

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

(In [5968]) Fix xhtml output for RSS widget when feed contains no items. Fixed #4671 props brettz95 and Nazgul

Note: See TracTickets for help on using tickets.