Make WordPress Core

Changeset 37811


Ignore:
Timestamp:
06/21/2016 02:53:01 PM (10 years ago)
Author:
nbachiyski
Message:

Admin: escape URL-encoded permalinks

Merge of [37801] to the 4.3 branch.

File:
1 edited

Legend:

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

    r37771 r37811  
    13141314                }
    13151315
    1316                 $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
    1317                 $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
     1316                $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . esc_html( $post_name_abridged ) . '</span>';
     1317                $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
    13181318                $pretty_permalink = str_replace( array( '%pagename%', '%postname%' ), $post_name, urldecode( $permalink ) );
    13191319
     
    13221322                $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
    13231323                $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __( 'Edit' ) . "</a></span>\n";
    1324                 $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
     1324                $return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
    13251325        }
    13261326
     
    13361336                        }
    13371337
    1338                         $return .= "<span id='view-post-btn'><a href='" . $pretty_permalink . "' class='button button-small'>$view_post</a></span>\n";
     1338                        $return .= "<span id='view-post-btn'><a href='" . esc_url( $pretty_permalink ) . "' class='button button-small'>$view_post</a></span>\n";
    13391339                }
    13401340        }
Note: See TracChangeset for help on using the changeset viewer.