X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/ff81ee6e8304a1982a3ec4f5b134764a29d502cf..022dfbbbe3215917d84708eb09acca93b21ae9e0:/wp-includes/template-functions-category.php diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index 1858bec4..00eadc0e 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -3,8 +3,9 @@ function get_the_category($id = false) { global $post, $category_cache; + $id = (int) $id; if ( !$id ) - $id = $post->ID; + $id = (int) $post->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 = ""; - 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 = '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 - $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).'';