Comments: Escape permalink values on edit screen to prevent XSS.

There doesn't appear to be any way for an attacker to introduce malicious input into the URL, unless a plugin is filtering the URL to add it, but it's better to be safe than sorry.

Props 1naveengiri, joyously.
Merges [43290] to the 4.9 branch.
Fixes #44115.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43301 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2018-05-21 12:39:54 +00:00
parent e563e309e2
commit 2e3e405fdb

View File

@ -29,7 +29,11 @@ if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_
<div class="inside">
<div id="comment-link-box">
<strong><?php _ex( 'Permalink:', 'comment' ); ?></strong>
<span id="sample-permalink"><a href="<?php echo $comment_link; ?>"><?php echo $comment_link; ?></a></span>
<span id="sample-permalink">
<a href="<?php echo esc_url( $comment_link ); ?>">
<?php echo esc_html( $comment_link ); ?>
</a>
</span>
</div>
</div>
<?php endif; ?>