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.
Built from https://develop.svn.wordpress.org/branches/4.9@43301


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-05-21 12:40:26 +00:00
parent 4d9aadc80c
commit e782caa1e7
2 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,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 = '4.9.7-alpha-43300'; $wp_version = '4.9.7-alpha-43301';
/** /**
* 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.