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.
Fixes #44115.


git-svn-id: https://develop.svn.wordpress.org/trunk@43290 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ian Dunn 2018-05-16 22:38:20 +00:00
parent d488fc7dac
commit ac4d875f94

View File

@ -30,7 +30,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; ?>