Ticket #20106: 20106.2.patch
File 20106.2.patch, 5.1 KB (added by , 12 years ago) |
---|
-
wp-includes/category-template.php
56 56 } 57 57 58 58 if ( $link ) 59 $chain .= '<a href="' . get_category_link( $parent->term_id) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator;59 $chain .= '<a href="' . esc_url( get_category_link( $parent->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator; 60 60 else 61 61 $chain .= $name.$separator; 62 62 return $chain; … … 171 171 case 'multiple': 172 172 if ( $category->parent ) 173 173 $thelist .= get_category_parents( $category->parent, true, $separator ); 174 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';174 $thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>'; 175 175 break; 176 176 case 'single': 177 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>';177 $thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>'; 178 178 if ( $category->parent ) 179 179 $thelist .= get_category_parents( $category->parent, false, $separator ); 180 180 $thelist .= $category->name.'</a></li>'; 181 181 break; 182 182 case '': 183 183 default: 184 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';184 $thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>'; 185 185 } 186 186 } 187 187 $thelist .= '</ul>'; … … 194 194 case 'multiple': 195 195 if ( $category->parent ) 196 196 $thelist .= get_category_parents( $category->parent, true, $separator ); 197 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a>';197 $thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a>'; 198 198 break; 199 199 case 'single': 200 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>';200 $thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>'; 201 201 if ( $category->parent ) 202 202 $thelist .= get_category_parents( $category->parent, false, $separator ); 203 203 $thelist .= "$category->name</a>"; 204 204 break; 205 205 case '': 206 206 default: 207 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a>';207 $thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a>'; 208 208 } 209 209 ++$i; 210 210 } … … 825 825 826 826 $cat_name = esc_attr( $category->name ); 827 827 $cat_name = apply_filters( 'list_cats', $cat_name, $category ); 828 $link = '<a href="' . esc_ attr( get_term_link($category) ) . '" ';828 $link = '<a href="' . esc_url( get_term_link($category) ) . '" '; 829 829 if ( $use_desc_for_title == 0 || empty($category->description) ) 830 830 $link .= 'title="' . esc_attr( sprintf(__( 'View all posts filed under %s' ), $cat_name) ) . '"'; 831 831 else … … 839 839 if ( empty($feed_image) ) 840 840 $link .= '('; 841 841 842 $link .= '<a href="' . get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type) . '"';842 $link .= '<a href="' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) ) . '"'; 843 843 844 844 if ( empty($feed) ) { 845 845 $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; … … 1108 1108 $link = get_term_link( $term, $taxonomy ); 1109 1109 if ( is_wp_error( $link ) ) 1110 1110 return $link; 1111 $term_links[] = '<a href="' . $link. '" rel="tag">' . $term->name . '</a>';1111 $term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>'; 1112 1112 } 1113 1113 1114 1114 $term_links = apply_filters( "term_links-$taxonomy", $term_links );