Admin: escape URL-encoded permalinks
Merge of [37801] to the 4.0 branch. Built from https://develop.svn.wordpress.org/branches/4.0@37817 git-svn-id: http://core.svn.wordpress.org/branches/4.0@37782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e16790e7e2
commit
8197793447
|
@ -1220,7 +1220,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {
|
if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {
|
||||||
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n";
|
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . esc_html( $permalink ) . "</span>\n";
|
||||||
if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) {
|
if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) {
|
||||||
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
|
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
|
||||||
}
|
}
|
||||||
|
@ -1239,14 +1239,14 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
|
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . esc_html( $post_name_abridged ) . '</span>';
|
||||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, $permalink );
|
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( $permalink ) );
|
||||||
|
|
||||||
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
|
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
|
||||||
$return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
|
$return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
|
||||||
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
|
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
|
||||||
$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";
|
$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";
|
||||||
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
|
$return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $view_post ) ) {
|
if ( isset( $view_post ) ) {
|
||||||
|
@ -1256,7 +1256,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||||
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
|
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
|
||||||
$return .= "<span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "' class='button button-small' target='wp-preview-{$post->ID}'>$view_post</a></span>\n";
|
$return .= "<span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "' class='button button-small' target='wp-preview-{$post->ID}'>$view_post</a></span>\n";
|
||||||
} else {
|
} else {
|
||||||
$return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n";
|
$return .= "<span id='view-post-btn'><a href='" . esc_url( get_permalink( $post ) ) . "' class='button button-small'>$view_post</a></span>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue