mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 16:21:26 +01:00
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:
parent
f8258351b4
commit
a56fac823a
@ -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);
|
||||
|
||||
|
@ -312,12 +312,14 @@ 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");
|
||||
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) {
|
||||
$cat_dates = $wpdb->get_results(" SELECT cat_ID,
|
||||
|
Loading…
Reference in New Issue
Block a user