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

git-svn-id: https://develop.svn.wordpress.org/trunk@7244 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2008-03-11 18:18:22 +00:00
parent eda2d37158
commit e3d814abc3
4 changed files with 20 additions and 3 deletions
+17
View File
@@ -231,4 +231,21 @@ function prep_atom_text_construct($data) {
}
}
/**
* self_link() - Generate a correct link for the atom:self elemet
*
* Echo the link for the currently displayed feed in a XSS safe way.
*
* @package WordPress
* @subpackage Feed
* @since 2.5
*
*/
function self_link() {
echo 'http'
. ( $_SERVER['https'] == 'on' ? 's' : '' ) . '://'
. $_SERVER['HTTP_HOST']
. wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1);
}
?>