Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 17 months ago

#3556 closed defect (bug) (fixed)

warning generated by _pad_category_counts() when no posts

Reported by: dougal's profile dougal Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: Template Keywords:
Focuses: Cc:

Description

If there are no posts in the db, _pad_category_counts() generates a warning due to a foreach over an empty array. Diff attached.

Attachments (1)

category.php.diff (520 bytes) - added by dougal 19 years ago.
fix empty foreach warning

Download all attachments as: .zip

Change History (3)

@dougal
19 years ago

fix empty foreach warning

#1 @foolswisdom
19 years ago

Warning generated is:

Warning: Invalid argument supplied for foreach() in
/web/server/path/httpd.www/lions/wp-includes/category.php on line 297

#2 @ryan
19 years ago

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

(In [4716]) Cast to array to avoid warning. fixes #3556

Note: See TracTickets for help on using tickets.