Admin: escape URL-encoded permalinks

Merge of [37801] to the 4.5 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37806 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Nikolay Bachiyski 2016-06-21 14:48:36 +00:00
parent d1f3bf8f4c
commit 0044fc9791

View File

@ -1319,7 +1319,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
if ( false !== $view_link ) {
$display_link = urldecode( $view_link );
$return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a>\n";
$return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . esc_html( $display_link ) . "</a>\n";
} else {
$return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
}
@ -1343,14 +1343,14 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
}
}
$post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
$post_name_html = '<span id="editable-post-name">' . esc_html( $post_name_abridged ) . '</span>';
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
$return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n";
$return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
$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";
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
$return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
}
/**