WordPress.org

Make WordPress Core

Ticket #17562: 17562.the-permalink-escape-output.diff

File 17562.the-permalink-escape-output.diff, 471 bytes (added by mfields, 4 years ago)

Filter output of the_permalink() through esc_url() before printing.

  • wp-includes/link-template.php

     
    1313 * @uses apply_filters() Calls 'the_permalink' filter on the permalink string. 
    1414 */ 
    1515function the_permalink() { 
    16         echo apply_filters('the_permalink', get_permalink()); 
     16        echo esc_url( apply_filters( 'the_permalink', get_permalink() ) ); 
    1717} 
    1818 
    1919/**