]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/template-functions-category.php
Wordpress 2.0.11
[autoinstalls/wordpress.git] / wp-includes / template-functions-category.php
index 1858bec4f96f66b1fc324f09803090f6cd6c877f..00eadc0e65ef7325bb398dfdb722b5e08a4d368d 100644 (file)
@@ -3,8 +3,9 @@
 function get_the_category($id = false) {
 global $post, $category_cache;
 
 function get_the_category($id = false) {
 global $post, $category_cache;
 
+       $id = (int) $id;
        if ( !$id )
        if ( !$id )
-               $id = $post->ID;
+               $id = (int) $post->ID;
 
        if ( !isset($category_cache[$id]) )
                update_post_category_cache($id);
 
        if ( !isset($category_cache[$id]) )
                update_post_category_cache($id);
@@ -318,14 +319,14 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
        $num_found=0;
        $thelist = "";
 
        $num_found=0;
        $thelist = "";
 
-       foreach ( $categories as $category ) {
+       foreach ( (array) $categories as $category ) {
                if ( ( intval($hide_empty) == 0 || $category->category_count) && (!$hierarchical || $category->category_parent == $child_of) ) {
                        $num_found++;
                        $link = '<a href="'.get_category_link($category->cat_ID).'" ';
                        if ( $use_desc_for_title == 0 || empty($category->category_description) )
                if ( ( intval($hide_empty) == 0 || $category->category_count) && (!$hierarchical || $category->category_parent == $child_of) ) {
                        $num_found++;
                        $link = '<a href="'.get_category_link($category->cat_ID).'" ';
                        if ( $use_desc_for_title == 0 || empty($category->category_description) )
-                               $link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
+                               $link .= 'title="'. sprintf(__("View all posts filed under %s"), attribute_escape($category->cat_name)) . '"';
                        else
                        else
-                               $link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category)) . '"';
+                               $link .= 'title="' . attribute_escape(apply_filters('category_description',$category->category_description,$category)) . '"';
                        $link .= '>';
                        $link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';
 
                        $link .= '>';
                        $link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';