Make WordPress Core

Changeset 7244


Ignore:
Timestamp:
03/11/2008 06:18:22 PM (17 years ago)
Author:
westi
Message:

Better self links for feeds. Fixes #5238 props andy.

Location:
trunk/wp-includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/feed-atom.php

    r6493 r7244  
    2626    <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
    2727    <id><?php bloginfo('atom_url'); ?></id>
    28     <link rel="self" type="application/atom+xml" href="<?php bloginfo('atom_url'); ?>" />
     28    <link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
    2929
    3030    <?php do_action('atom_head'); ?>
  • trunk/wp-includes/feed-rss2-comments.php

    r6742 r7244  
    2424            printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
    2525    ?></title>
    26     <atom:link href="<?php bloginfo('comments_rss2_url') ?>" rel="self" type="application/rss+xml" />
     26    <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    2727    <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
    2828    <description><?php bloginfo_rss("description") ?></description>
  • trunk/wp-includes/feed-rss2.php

    r6517 r7244  
    2222<channel>
    2323    <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
    24     <atom:link href="<?php bloginfo('rss2_url') ?>" rel="self" type="application/rss+xml" />
     24    <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    2525    <link><?php bloginfo_rss('url') ?></link>
    2626    <description><?php bloginfo_rss("description") ?></description>
  • trunk/wp-includes/feed.php

    r6777 r7244  
    232232}
    233233
     234/**
     235 * self_link() - Generate a correct link for the atom:self elemet
     236 *
     237 * Echo the link for the currently displayed feed in a XSS safe way.
     238 *
     239 * @package WordPress
     240 * @subpackage Feed
     241 * @since 2.5
     242 *
     243 */
     244function self_link() {
     245    echo 'http'
     246        . ( $_SERVER['https'] == 'on' ? 's' : '' ) . '://'
     247        . $_SERVER['HTTP_HOST']
     248        . wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1);
     249}
     250
    234251?>
Note: See TracChangeset for help on using the changeset viewer.