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.

Built from https://develop.svn.wordpress.org/trunk@43290


git-svn-id: http://core.svn.wordpress.org/trunk@43119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
iandunn 2018-05-16 22:39:21 +00:00
parent 461d17576c
commit 2754419731
2 changed files with 6 additions and 2 deletions

View File

@ -30,7 +30,11 @@ if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_
<div class="inside"> <div class="inside">
<div id="comment-link-box"> <div id="comment-link-box">
<strong><?php _ex( 'Permalink:', 'comment' ); ?></strong> <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>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-43286'; $wp_version = '5.0-alpha-43290';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.