Ticket #14201: 14201.2.patch
File 14201.2.patch, 1.7 KB (added by , 15 years ago) |
---|
-
wp-includes/category-template.php
17 17 */ 18 18 function get_category_link( $category_id ) { 19 19 global $wp_rewrite; 20 $catlink = $wp_rewrite->get_category_permastruct();20 $catlink = urlencode( $wp_rewrite->get_category_permastruct() ); 21 21 22 22 if ( empty( $catlink ) ) { 23 23 $catlink = home_url('?cat=' . $category_id); … … 32 32 elseif ($category->parent != 0 ) 33 33 $category_nicename = get_category_parents( $category->parent, false, '/', true ) . $category_nicename; 34 34 35 $catlink = str_replace( '%category%', $category_nicename, $catlink ); 35 $catlink = str_replace( '%25category%25', $category_nicename, $catlink ); 36 $catlink = str_replace( '%2F', '/', $catlink ); 36 37 $catlink = home_url( user_trailingslashit( $catlink, 'category' ) ); 37 38 } 38 39 return apply_filters( 'category_link', $catlink, $category_id ); … … 792 793 */ 793 794 function get_tag_link( $tag_id ) { 794 795 global $wp_rewrite; 795 $taglink = $wp_rewrite->get_tag_permastruct();796 $taglink = urlencode( $wp_rewrite->get_tag_permastruct() ); 796 797 797 798 $tag = &get_term( $tag_id, 'post_tag' ); 798 799 if ( is_wp_error( $tag ) ) … … 803 804 $file = get_option( 'home' ) . '/'; 804 805 $taglink = $file . '?tag=' . $slug; 805 806 } else { 806 $taglink = str_replace( '%tag%', $slug, $taglink ); 807 $taglink = str_replace( '%25tag%25', $slug, $taglink ); 808 $taglink = str_replace( '%2F', '/', $taglink ); 807 809 $taglink = get_option( 'home' ) . user_trailingslashit( $taglink, 'category' ); 808 810 } 809 811 return apply_filters( 'tag_link', $taglink, $tag_id );