Plugin Directory

Changeset 3207795


Ignore:
Timestamp:
12/13/2024 08:33:49 PM (14 months ago)
Author:
theandystratton
Message:

Update to v1.9.0 – fixes for security review

Location:
the-permalinker
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • the-permalinker/trunk/readme.txt

    r2945667 r3207795  
    3636
    3737== Changelog ==
     38
     39= 1.9.0 =
     40* Added important security enhancements for escaping URLs and HTML content to prevent XSS and other potential security holes
     41* Some legacy output may be affected as we are now escaping URLs and HTML attributes.
     42* Content inside of the shortcode should _not_ be escaped as we want to preserve any HTML within that shortcode content/anchor text.
    3843
    3944= 1.8.0 =
  • the-permalinker/trunk/the-permalinker.php

    r2805311 r3207795  
    55Plugin URI: http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks
    66Author URI: http://theandystratton.com
    7 Version: 1.8.1
     7Version: 1.9.0
    88Description: Add dynamically created permalinks using the short code tag [permalink] and output dynamic links to your current template directory using short code [template_uri]. <a href="options-general.php?page=permalinker_help">Need help?</a>
    99*/
     
    2828    if ( !empty($content) )
    2929    {
    30         $output = '<a href="' . \get_permalink( $id ) . \esc_attr( $append ) . '"';
     30        $output = '<a href="' . \esc_url( \get_permalink( $id ) . \esc_attr( $append ) ) . '"';
    3131       
    3232        if ( !empty( $target ) )
    33             $output .= ' target="' . $target . '"';
     33            $output .= ' target="' . \esc_attr( $target ) . '"';
    3434
    35         $output .= ' class="permalinker_link ' . $class . '"';
     35        $output .= ' class="permalinker_link ' . \esc_attr( $class ) . '"';
    3636
    3737        if ( !empty($rel) )
    38             $output .= ' rel="' . $rel . '"';
     38            $output .= ' rel="' . \esc_attr( $rel ) . '"';
    3939
    4040        $output .= '>' . \str_replace( '%post_title%', \get_the_title( $id ), $content ) . '</a>';
     
    4242    else
    4343    {
    44         $output = \get_permalink( $id ) . $append;
     44        $output = \esc_url( \get_permalink( $id ) . \esc_attr( $append ) );
    4545    }
    4646    return $output;
     
    5151//
    5252function permalinker_template_uri( $atts, $content = null ) {
    53     return \get_template_directory_uri();
     53    return \esc_url( \get_template_directory_uri() );
    5454}
    5555
Note: See TracChangeset for help on using the changeset viewer.