Guard against empty $cat_counts array. http://wordpress.org/support/3/6080

git-svn-id: http://svn.automattic.com/wordpress/trunk@1389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-06-06 07:21:58 +00:00
parent f8258351b4
commit a56fac823a
2 changed files with 8 additions and 6 deletions

View File

@ -1409,7 +1409,7 @@ function check_comment($author, $email, $url, $comment, $user_ip) {
}
function query_posts($query) {
global $wpdb, $pagenow, $request;
global $wpdb, $pagenow, $request, $user_ID;
parse_str($query);

View File

@ -312,11 +312,13 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
INNER JOIN $wpdb->posts ON (ID = post_id)
WHERE post_status = 'publish' $exclusions
GROUP BY category_id");
foreach ($cat_counts as $cat_count) {
if (1 != intval($hide_empty) || $cat_count > 0) {
$category_posts["$cat_count->cat_ID"] = $cat_count->cat_count;
}
}
if (! empty($cat_counts)) {
foreach ($cat_counts as $cat_count) {
if (1 != intval($hide_empty) || $cat_count > 0) {
$category_posts["$cat_count->cat_ID"] = $cat_count->cat_count;
}
}
}
}
if (intval($optiondates) == 1) {