From e88b66ee00374d25e377dd942ac38aa459991409 Mon Sep 17 00:00:00 2001 From: westi Date: Fri, 23 Apr 2010 21:20:16 +0000 Subject: [PATCH] Added escaping to wp_shortlink_wp_head() too. See #10640 props sirzooro. git-svn-id: http://svn.automattic.com/wordpress/trunk@14207 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 8b6c1a4636..7643668af1 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2199,12 +2199,12 @@ function wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) { * @uses wp_get_shortlink() */ function wp_shortlink_wp_head() { - $shortlink = wp_get_shortlink(0, 'query'); + $shortlink = wp_get_shortlink( 0, 'query' ); - if ( empty($shortlink) ) + if ( empty( $shortlink ) ) return; - echo "\n"; + echo "\n"; } /** @@ -2242,19 +2242,22 @@ function wp_shortlink_header() { * @param string $before Optional HTML to display before the link. * @param string $before Optional HTML to display after the link. */ -function the_shortlink($text = '', $title = '', $before = '', $after = '') { +function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) { global $post; - if ( empty($text) ) + if ( empty( $text ) ) $text = __('This is the short link.'); - if ( empty($title) ) - $title = the_title_attribute( array('echo' => FALSE) ); + if ( empty( $title ) ) + $title = the_title_attribute( array( 'echo' => FALSE ) ); - $shortlink = wp_get_shortlink($post->ID); + $shortlink = wp_get_shortlink( $post->ID ); - if ( !empty($shortlink) ) - echo "$before$text$after"; + if ( !empty( $shortlink ) ) { + $link = '' . $text . ''; + $link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title ); + echo $before, $link, $after; + } } ?>