Ensure post titles are correctly escaped on the Dashboard. Merge of [32175] to the 3.7 branch.

Props helen, ocean90, dd32, pento.


Built from https://develop.svn.wordpress.org/branches/3.7@32206


git-svn-id: http://core.svn.wordpress.org/branches/3.7@32179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2015-04-20 13:44:10 +00:00
parent 03874af5c9
commit f51aa3949c
5 changed files with 8 additions and 8 deletions

View File

@ -493,9 +493,9 @@ class WP_Comments_List_Table extends WP_List_Table {
if ( current_user_can( 'edit_post', $post->ID ) ) {
$post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
$post_link .= get_the_title( $post->ID ) . '</a>';
$post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
} else {
$post_link = get_the_title( $post->ID );
$post_link = esc_html( get_the_title( $post->ID ) );
}
echo '<div class="response-links"><span class="post-com-count-wrapper">';

View File

@ -658,7 +658,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
$GLOBALS['comment'] =& $comment;
$comment_post_url = get_edit_post_link( $comment->comment_post_ID );
$comment_post_title = strip_tags(get_the_title( $comment->comment_post_ID ));
$comment_post_title = _draft_or_post_title( $comment->comment_post_ID );
$comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
$comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';

View File

@ -1373,7 +1373,7 @@ function _draft_or_post_title( $post = 0 ) {
$title = get_the_title( $post );
if ( empty( $title ) )
$title = __( '(no title)' );
return $title;
return esc_html( $title );
}
/**

View File

@ -444,14 +444,14 @@ var wpNavMenu;
if ( ! isPrimaryMenuItem ) {
var thisLink = menuItem.find( '.menus-move-left' ),
thisLinkText = menus.outFrom.replace( '%s', prevItemNameLeft );
thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).html( thisLinkText ).css( 'display', 'inline' );
thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).text( thisLinkText ).css( 'display', 'inline' );
}
if ( 0 !== position ) {
if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) {
var thisLink = menuItem.find( '.menus-move-right' ),
thisLinkText = menus.under.replace( '%s', prevItemNameRight );
thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).html( thisLinkText ).css( 'display', 'inline' );
thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).text( thisLinkText ).css( 'display', 'inline' );
}
}
@ -473,7 +473,7 @@ var wpNavMenu;
title = menus.subMenuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$s', parentItemName );
}
$this.prop('title', title).html( title );
$this.prop('title', title).text( title );
});
},

File diff suppressed because one or more lines are too long