Make WordPress Core

Changeset 23527


Ignore:
Timestamp:
02/28/2013 06:56:39 PM (12 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r23416 r23527  
    1414 */
    1515function the_permalink() {
    16     echo apply_filters('the_permalink', get_permalink());
     16    echo esc_url( apply_filters( 'the_permalink', get_permalink() ) );
    1717}
    1818
Note: See TracChangeset for help on using the changeset viewer.