Make WordPress Core


Ignore:
Timestamp:
05/05/2009 10:22:20 PM (16 years ago)
Author:
ryan
Message:

Slashe before query args. Props peaceablewhale. fixes #9515

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r11204 r11210  
    155155        return apply_filters('post_link', $permalink, $post, $leavename);
    156156    } 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;
    158158        return apply_filters('post_link', $permalink, $post, $leavename);
    159159    }
     
    226226        $link = get_page_uri($id);
    227227        $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct);
    228         $link = get_option('home') . "/$link";
     228        $link = user_trailingslashit(get_option('home')) . "$link";
    229229        $link = user_trailingslashit($link, 'page');
    230230    } else {
    231         $link = get_option('home') . "/?page_id=$id";
     231        $link = user_trailingslashit(get_option('home')) . "?page_id=$id";
    232232    }
    233233
     
    270270
    271271    if (! $link ) {
    272         $link = get_bloginfo('url') . "/?attachment_id=$id";
     272        $link = user_trailingslashit(get_bloginfo('url')) . "?attachment_id=$id";
    273273    }
    274274
     
    293293        return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year);
    294294    } 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);
    296296    }
    297297}
     
    318318        return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month);
    319319    } 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);
    321321    }
    322322}
     
    348348        return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day);
    349349    } 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);
    351351    }
    352352}
     
    383383            $feed = str_replace('comments_', 'comments-', $feed);
    384384
    385         $output = get_option('home') . "/?feed={$feed}";
     385        $output = user_trailingslashit(get_option('home')) . "?feed={$feed}";
    386386    }
    387387
     
    415415        $type = get_post_field('post_type', $post_id);
    416416        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";
    418418        else
    419             $url = get_option('home') . "/?feed=$feed&p=$post_id";
     419            $url = user_trailingslashit(get_option('home')) . "?feed=$feed&p=$post_id";
    420420    }
    421421
     
    469469
    470470    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;
    472472    } else {
    473473        $link = get_author_posts_url($author_id);
     
    513513
    514514    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;
    516516    } else {
    517517        $link = get_category_link($cat_id);
     
    552552
    553553    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;
    555555    } else {
    556556        $link = get_tag_link($tag->term_id);
     
    627627        $feed = get_default_feed();
    628628
    629     $link = get_option('home') . "?s=$search&feed=$feed";
     629    $link = user_trailingslashit(get_option('home')) . "?s=$search&feed=$feed";
    630630
    631631    $link = apply_filters('search_feed_link', $link);
     
    652652        $feed = get_default_feed();
    653653
    654     $link = get_option('home') . "?s=$search&feed=comments-$feed";
     654    $link = user_trailingslashit(get_option('home')) . "?s=$search&feed=comments-$feed";
    655655
    656656    $link = apply_filters('search_feed_link', $link);
Note: See TracChangeset for help on using the changeset viewer.