WordPress.org

Make WordPress Core

Changeset 37806


Ignore:
Timestamp:
06/21/2016 02:48:36 PM (3 years ago)
Author:
nbachiyski
Message:

Admin: escape URL-encoded permalinks

Merge of [37801] to the 4.5 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5/src/wp-admin/includes/post.php

    r37759 r37806  
    13201320        if ( false !== $view_link ) {
    13211321            $display_link = urldecode( $view_link );
    1322             $return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a>\n";
     1322            $return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . esc_html( $display_link ) . "</a>\n";
    13231323        } else {
    13241324            $return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
     
    13441344        }
    13451345
    1346         $post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
    1347         $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
     1346        $post_name_html = '<span id="editable-post-name">' . esc_html( $post_name_abridged ) . '</span>';
     1347        $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
    13481348
    13491349        $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
     
    13511351        $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
    13521352        $return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js" aria-label="' . __( 'Edit permalink' ) . '">' . __( 'Edit' ) . "</button></span>\n";
    1353         $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
     1353        $return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
    13541354    }
    13551355
Note: See TracChangeset for help on using the changeset viewer.