Ticket #3556 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

warning generated by _pad_category_counts() when no posts

Reported by: dougal Assigned to: anonymous
Priority: normal Milestone: 2.1
Component: Template Version: 2.1
Severity: normal Keywords:
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

category.php.diff (0.5 kB) - added by dougal on 01/10/07 17:31:05.
fix empty foreach warning

Change History

01/10/07 17:31:05 changed by dougal

  • attachment category.php.diff added.

fix empty foreach warning

01/10/07 19:37:11 changed by foolswisdom

Warning generated is:

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

01/10/07 20:42:19 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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