From 48f23ba3a5569121ee9f3125fb578984f530cfea Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 28 Feb 2013 18:56:39 +0000 Subject: [PATCH] Automatically esc_url() the URL echoed by the_permalink(). This makes the_permalink() useful, rather than needing to do `echo esc_url( get_permalink() )` to get proper encoding of ampersands, etc. This will not double-encode when esc_url() has already been applied to the filter here, but that code can now be removed. props mfields. fixes #17562. git-svn-id: http://core.svn.wordpress.org/trunk@23527 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index b53a6fd7a5..90a2819a0a 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -13,7 +13,7 @@ * @uses apply_filters() Calls 'the_permalink' filter on the permalink string. */ function the_permalink() { - echo apply_filters('the_permalink', get_permalink()); + echo esc_url( apply_filters( 'the_permalink', get_permalink() ) ); } /**