Ticket #9515: link-template.php-trunk-user_trailingslashit.patch
File link-template.php-trunk-user_trailingslashit.patch, 5.1 KB (added by , 16 years ago) |
---|
-
link-template.php
154 154 $permalink = user_trailingslashit($permalink, 'single'); 155 155 return apply_filters('post_link', $permalink, $post, $leavename); 156 156 } else { // if they're not using the fancy permalink option 157 $permalink = get_option('home') . '/?p=' . $post->ID;157 $permalink = user_trailingslashit(get_option('home')) . '?p=' . $post->ID; 158 158 return apply_filters('post_link', $permalink, $post, $leavename); 159 159 } 160 160 } … … 225 225 if ( '' != $pagestruct && ( ( isset($post->post_status) && 'draft' != $post->post_status ) || $sample ) ) { 226 226 $link = get_page_uri($id); 227 227 $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct); 228 $link = get_option('home') . "/$link";228 $link = trailingslashit(get_option('home')) . "$link"; 229 229 $link = user_trailingslashit($link, 'page'); 230 230 } else { 231 $link = get_option('home') . "/?page_id=$id";231 $link = user_trailingslashit(get_option('home')) . "?page_id=$id"; 232 232 } 233 233 234 234 return apply_filters( '_get_page_link', $link, $id ); … … 269 269 } 270 270 271 271 if (! $link ) { 272 $link = get_bloginfo('url') . "/?attachment_id=$id";272 $link = user_trailingslashit(get_bloginfo('url')) . "?attachment_id=$id"; 273 273 } 274 274 275 275 return apply_filters('attachment_link', $link, $id); … … 292 292 $yearlink = str_replace('%year%', $year, $yearlink); 293 293 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year); 294 294 } else { 295 return apply_filters('year_link', get_option('home') . '/?m=' . $year, $year);295 return apply_filters('year_link', user_trailingslashit(get_option('home')) . '?m=' . $year, $year); 296 296 } 297 297 } 298 298 … … 317 317 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 318 318 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month); 319 319 } else { 320 return apply_filters('month_link', get_option('home') . '/?m=' . $year . zeroise($month, 2), $year, $month);320 return apply_filters('month_link', user_trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2), $year, $month); 321 321 } 322 322 } 323 323 … … 347 347 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 348 348 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day); 349 349 } else { 350 return apply_filters('day_link', get_option('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);350 return apply_filters('day_link', user_trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day); 351 351 } 352 352 } 353 353 … … 382 382 if ( false !== strpos($feed, 'comments_') ) 383 383 $feed = str_replace('comments_', 'comments-', $feed); 384 384 385 $output = get_option('home') . "/?feed={$feed}";385 $output = user_trailingslashit(get_option('home')) . "?feed={$feed}"; 386 386 } 387 387 388 388 return apply_filters('feed_link', $output, $feed); … … 414 414 } else { 415 415 $type = get_post_field('post_type', $post_id); 416 416 if ( 'page' == $type ) 417 $url = get_option('home') . "/?feed=$feed&page_id=$post_id";417 $url = user_trailingslashit(get_option('home')) . "?feed=$feed&page_id=$post_id"; 418 418 else 419 $url = get_option('home') . "/?feed=$feed&p=$post_id";419 $url = user_trailingslashit(get_option('home')) . "?feed=$feed&p=$post_id"; 420 420 } 421 421 422 422 return apply_filters('post_comments_feed_link', $url); … … 468 468 $feed = get_default_feed(); 469 469 470 470 if ( '' == $permalink_structure ) { 471 $link = get_option('home') . "?feed=$feed&author=" . $author_id;471 $link = user_trailingslashit(get_option('home')) . "?feed=$feed&author=" . $author_id; 472 472 } else { 473 473 $link = get_author_posts_url($author_id); 474 474 if ( $feed == get_default_feed() ) … … 512 512 $permalink_structure = get_option('permalink_structure'); 513 513 514 514 if ( '' == $permalink_structure ) { 515 $link = trailingslashit( get_option('home')) . "?feed=$feed&cat=" . $cat_id;515 $link = user_trailingslashit(get_option('home')) . "?feed=$feed&cat=" . $cat_id; 516 516 } else { 517 517 $link = get_category_link($cat_id); 518 518 if( $feed == get_default_feed() ) … … 551 551 $feed = get_default_feed(); 552 552 553 553 if ( '' == $permalink_structure ) { 554 $link = get_option('home') . "?feed=$feed&tag=" . $tag->slug;554 $link = user_trailingslashit(get_option('home')) . "?feed=$feed&tag=" . $tag->slug; 555 555 } else { 556 556 $link = get_tag_link($tag->term_id); 557 557 if ( $feed == get_default_feed() ) … … 626 626 if ( empty($feed) ) 627 627 $feed = get_default_feed(); 628 628 629 $link = get_option('home') . "?s=$search&feed=$feed";629 $link = user_trailingslashit(get_option('home')) . "?s=$search&feed=$feed"; 630 630 631 631 $link = apply_filters('search_feed_link', $link); 632 632 … … 651 651 if ( empty($feed) ) 652 652 $feed = get_default_feed(); 653 653 654 $link = get_option('home') . "?s=$search&feed=comments-$feed";654 $link = user_trailingslashit(get_option('home')) . "?s=$search&feed=comments-$feed"; 655 655 656 656 $link = apply_filters('search_feed_link', $link); 657 657