Changeset 4886
- Timestamp:
- 02/15/2007 07:07:12 AM (18 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r4795 r4886 33 33 34 34 if ( $parent = $category->category_parent ) 35 $category_nicename = get_category_parents($parent, false, '/', true) . $category_nicename . '/';35 $category_nicename = get_category_parents($parent, false, '/', true) . $category_nicename; 36 36 37 37 $catlink = str_replace('%category%', $category_nicename, $catlink); 38 $catlink = get_option('home') . trailingslashit($catlink);38 $catlink = get_option('home') . user_trailingslashit($catlink); 39 39 } 40 40 return apply_filters('category_link', $catlink, $category_id); -
trunk/wp-includes/comment-template.php
r4656 r4886 227 227 228 228 if ( '' != get_option('permalink_structure') ) 229 $tb_url = trailingslashit(get_permalink()) . 'trackback/';229 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback'); 230 230 231 231 return $tb_url; -
trunk/wp-includes/feed.php
r4805 r4886 100 100 101 101 if ( '' != get_option('permalink_structure') ) 102 $url = trailingslashit( get_permalink() ) . 'feed/';102 $url = trailingslashit( get_permalink() ) . user_trailingslashit('feed'); 103 103 else 104 104 $url = get_option('home') . "/$commentsrssfilename?feed=rss2&p=$id"; … … 116 116 } else { 117 117 $link = get_author_posts_url($author_id, $author_nicename); 118 $link = $link . "feed/";118 $link = $link . user_trailingslashit('feed'); 119 119 } 120 120 … … 134 134 } else { 135 135 $link = get_category_link($cat_ID); 136 $link = $link . "feed/";136 $link = $link . user_trailingslashit('feed/'); 137 137 } 138 138 -
trunk/wp-includes/link-template.php
r4721 r4886 9 9 function permalink_link() { // For backwards compatibility 10 10 echo apply_filters('the_permalink', get_permalink()); 11 } 12 13 14 /** 15 * Conditionally adds a trailing slash if the permalink structure 16 * has a trailing slash, strips the trailing slash if not 17 * @global object Uses $wp_rewrite 18 * @param $string string a URL with or without a trailing slash 19 * @return string 20 */ 21 function user_trailingslashit($string) { 22 global $wp_rewrite; 23 if ( $wp_rewrite->use_trailing_slashes ) 24 $string = trailingslashit($string); 25 else 26 $string = preg_replace('|/$|', '', $string); // untrailing slash 27 return $string; 11 28 } 12 29 … … 117 134 $link = get_page_uri($id); 118 135 $link = str_replace('%pagename%', $link, $pagestruct); 119 $link = get_option('home') . "/$link/"; 136 $link = get_option('home') . "/$link"; 137 $link = user_trailingslashit($link); 120 138 } else { 121 139 $link = get_option('home') . "/?page_id=$id"; … … 159 177 if ( !empty($yearlink) ) { 160 178 $yearlink = str_replace('%year%', $year, $yearlink); 161 return apply_filters('year_link', get_option('home') . trailingslashit($yearlink), $year);179 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink), $year); 162 180 } else { 163 181 return apply_filters('year_link', get_option('home') . '/?m=' . $year, $year); … … 175 193 $monthlink = str_replace('%year%', $year, $monthlink); 176 194 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 177 return apply_filters('month_link', get_option('home') . trailingslashit($monthlink), $year, $month);195 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink), $year, $month); 178 196 } else { 179 197 return apply_filters('month_link', get_option('home') . '/?m=' . $year . zeroise($month, 2), $year, $month); … … 195 213 $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink); 196 214 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 197 return apply_filters('day_link', get_option('home') . trailingslashit($daylink), $year, $month, $day);215 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink), $year, $month, $day); 198 216 } else { 199 217 return apply_filters('day_link', get_option('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day); … … 218 236 219 237 $permalink = str_replace('%feed%', $feed, $permalink); 220 $permalink = preg_replace('#/+#', '/', "/$permalink /");221 $output = get_option('home') . $permalink;238 $permalink = preg_replace('#/+#', '/', "/$permalink"); 239 $output = get_option('home') . user_trailingslashit($permalink); 222 240 } else { 223 241 if ( false !== strpos($feed, 'comments_') ) … … 436 454 $qstr = preg_replace('|^/+|', '', $qstr); 437 455 if ( $permalink ) 438 $qstr = trailingslashit($qstr);456 $qstr = user_trailingslashit($qstr); 439 457 $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_option('home') ) . $qstr ); 440 458 441 459 // showing /page/1/ or ?paged=1 is redundant 442 460 if ( 1 === $pagenum ) { 443 $qstr = str_replace('page/1/', '', $qstr); // for mod_rewrite style 461 $qstr = str_replace(user_trailingslashit('index.php/page/1'), '', $qstr); // for PATHINFO style 462 $qstr = str_replace(user_trailingslashit('page/1'), '', $qstr); // for mod_rewrite style 444 463 $qstr = remove_query_arg('paged', $qstr); // for query style 445 464 } -
trunk/wp-includes/rewrite.php
r4551 r4886 149 149 class WP_Rewrite { 150 150 var $permalink_structure; 151 var $use_trailing_slashes; 151 152 var $category_base; 152 153 var $category_structure; … … 877 878 unset($this->feed_structure); 878 879 unset($this->comment_feed_structure); 880 $this->use_trailing_slashes = ( substr($this->permalink_structure, -1, 1) == '/' ) ? true : false; 879 881 } 880 882
Note: See TracChangeset
for help on using the changeset viewer.