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
This commit is contained in:
Andrew Nacin 2013-02-28 18:56:39 +00:00
parent c362979823
commit 48f23ba3a5
1 changed files with 1 additions and 1 deletions

View File

@ -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() ) );
}
/**