Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#4671 closed defect (bug) (fixed)

Empty ul in RSS widget when only a title present

Reported by: brettz95's profile brettz95 Owned by: westi's profile 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 17 years ago.
Fix empty <ul> issue in widget.php
4671.diff (1.1 KB) - added by Nazgul 17 years ago.

Download all attachments as: .zip

Change History (6)

@brettz95
17 years ago

Fix empty <ul> issue in widget.php

#1 @Nazgul
17 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.

@Nazgul
17 years ago

#2 @Nazgul
17 years ago

Cleaner patch imho.

#3 @westi
17 years ago

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

+1 to Nazguls patch

#4 @westi
17 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.