WordPress.org

Make WordPress Core

Changeset 1389


Ignore:
Timestamp:
06/06/04 07:21:58 (10 years ago)
Author:
rboren
Message:

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r1388 r1389  
    14101410 
    14111411function query_posts($query) { 
    1412     global $wpdb, $pagenow, $request; 
     1412    global $wpdb, $pagenow, $request, $user_ID; 
    14131413 
    14141414    parse_str($query); 
  • trunk/wp-includes/template-functions-category.php

    r1385 r1389  
    313313        WHERE post_status = 'publish' $exclusions 
    314314        GROUP BY category_id"); 
    315         foreach ($cat_counts as $cat_count) { 
    316             if (1 != intval($hide_empty) || $cat_count > 0) { 
    317                 $category_posts["$cat_count->cat_ID"] = $cat_count->cat_count; 
    318             } 
    319         } 
     315        if (! empty($cat_counts)) { 
     316            foreach ($cat_counts as $cat_count) { 
     317                if (1 != intval($hide_empty) || $cat_count > 0) { 
     318                    $category_posts["$cat_count->cat_ID"] = $cat_count->cat_count; 
     319                } 
     320            } 
     321        } 
    320322    } 
    321323     
Note: See TracChangeset for help on using the changeset viewer.