Ticket #9515: link-template.php-2.7-trailingslashit.patch
File link-template.php-2.7-trailingslashit.patch, 5.0 KB (added by , 16 years ago) |
---|
-
link-template.php
151 151 $permalink = user_trailingslashit($permalink, 'single'); 152 152 return apply_filters('post_link', $permalink, $post, $leavename); 153 153 } else { // if they're not using the fancy permalink option 154 $permalink = get_option('home') . '/?p=' . $post->ID;154 $permalink = trailingslashit(get_option('home')) . '?p=' . $post->ID; 155 155 return apply_filters('post_link', $permalink, $post, $leavename); 156 156 } 157 157 } … … 220 220 if ( '' != $pagestruct && isset($post->post_status) && 'draft' != $post->post_status ) { 221 221 $link = get_page_uri($id); 222 222 $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct); 223 $link = get_option('home') . "/$link";223 $link = trailingslashit(get_option('home')) . "$link"; 224 224 $link = user_trailingslashit($link, 'page'); 225 225 } else { 226 $link = get_option('home') . "/?page_id=$id";226 $link = trailingslashit(get_option('home')) . "?page_id=$id"; 227 227 } 228 228 229 229 return apply_filters( '_get_page_link', $link, $id ); … … 264 264 } 265 265 266 266 if (! $link ) { 267 $link = get_bloginfo('url') . "/?attachment_id=$id";267 $link = trailingslashit(get_bloginfo('url')) . "?attachment_id=$id"; 268 268 } 269 269 270 270 return apply_filters('attachment_link', $link, $id); … … 287 287 $yearlink = str_replace('%year%', $year, $yearlink); 288 288 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year); 289 289 } else { 290 return apply_filters('year_link', get_option('home') . '/?m=' . $year, $year);290 return apply_filters('year_link', trailingslashit(get_option('home')) . '?m=' . $year, $year); 291 291 } 292 292 } 293 293 … … 312 312 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 313 313 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month); 314 314 } else { 315 return apply_filters('month_link', get_option('home') . '/?m=' . $year . zeroise($month, 2), $year, $month);315 return apply_filters('month_link', trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2), $year, $month); 316 316 } 317 317 } 318 318 … … 342 342 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 343 343 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day); 344 344 } else { 345 return apply_filters('day_link', get_option('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);345 return apply_filters('day_link', trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day); 346 346 } 347 347 } 348 348 … … 377 377 if ( false !== strpos($feed, 'comments_') ) 378 378 $feed = str_replace('comments_', 'comments-', $feed); 379 379 380 $output = get_option('home') . "/?feed={$feed}";380 $output = trailingslashit(get_option('home')) . "?feed={$feed}"; 381 381 } 382 382 383 383 return apply_filters('feed_link', $output, $feed); … … 409 409 } else { 410 410 $type = get_post_field('post_type', $post_id); 411 411 if ( 'page' == $type ) 412 $url = get_option('home') . "/?feed=$feed&page_id=$post_id";412 $url = trailingslashit(get_option('home')) . "?feed=$feed&page_id=$post_id"; 413 413 else 414 $url = get_option('home') . "/?feed=$feed&p=$post_id";414 $url = trailingslashit(get_option('home')) . "?feed=$feed&p=$post_id"; 415 415 } 416 416 417 417 return apply_filters('post_comments_feed_link', $url); … … 463 463 $feed = get_default_feed(); 464 464 465 465 if ( '' == $permalink_structure ) { 466 $link = get_option('home') . "?feed=$feed&author=" . $author_id;466 $link = trailingslashit(get_option('home')) . "?feed=$feed&author=" . $author_id; 467 467 } else { 468 468 $link = get_author_posts_url($author_id); 469 469 if ( $feed == get_default_feed() ) … … 507 507 $permalink_structure = get_option('permalink_structure'); 508 508 509 509 if ( '' == $permalink_structure ) { 510 $link = get_option('home') . "?feed=$feed&cat=" . $cat_id;510 $link = trailingslashit(get_option('home')) . "?feed=$feed&cat=" . $cat_id; 511 511 } else { 512 512 $link = get_category_link($cat_id); 513 513 if( $feed == get_default_feed() ) … … 546 546 $feed = get_default_feed(); 547 547 548 548 if ( '' == $permalink_structure ) { 549 $link = get_option('home') . "?feed=$feed&tag=" . $tag->slug;549 $link = trailingslashit(get_option('home')) . "?feed=$feed&tag=" . $tag->slug; 550 550 } else { 551 551 $link = get_tag_link($tag->term_id); 552 552 if ( $feed == get_default_feed() ) … … 621 621 if ( empty($feed) ) 622 622 $feed = get_default_feed(); 623 623 624 $link = get_option('home') . "?s=$search&feed=$feed";624 $link = trailingslashit(get_option('home')) . "?s=$search&feed=$feed"; 625 625 626 626 $link = apply_filters('search_feed_link', $link); 627 627 … … 646 646 if ( empty($feed) ) 647 647 $feed = get_default_feed(); 648 648 649 $link = get_option('home') . "?s=$search&feed=comments-$feed";649 $link = trailingslashit(get_option('home')) . "?s=$search&feed=comments-$feed"; 650 650 651 651 $link = apply_filters('search_feed_link', $link); 652 652