mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Don't allow unfiltered HTML comments from a frame. Props nacin. fixes #20812
git-svn-id: http://core.svn.wordpress.org/trunk@20974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0f1f59b092
commit
01dd4131b8
@ -816,8 +816,10 @@ function wp_comment_form_unfiltered_html_nonce() {
|
||||
if ( !empty($post) )
|
||||
$post_id = $post->ID;
|
||||
|
||||
if ( current_user_can('unfiltered_html') )
|
||||
wp_nonce_field('unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment', false);
|
||||
if ( current_user_can( 'unfiltered_html' ) ) {
|
||||
wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false );
|
||||
echo "<script>(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();</script>\n";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1363,10 +1363,15 @@ function wp_filter_nohtml_kses($data) {
|
||||
* @uses add_filter() See description for what functions are added to what hooks.
|
||||
*/
|
||||
function kses_init_filters() {
|
||||
// Normal filtering.
|
||||
add_filter('pre_comment_content', 'wp_filter_kses');
|
||||
// Normal filtering
|
||||
add_filter('title_save_pre', 'wp_filter_kses');
|
||||
|
||||
// Comment filtering
|
||||
if ( current_user_can( 'unfiltered_html' ) )
|
||||
add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
|
||||
else
|
||||
add_filter( 'pre_comment_content', 'wp_filter_kses' );
|
||||
|
||||
// Post filtering
|
||||
add_filter('content_save_pre', 'wp_filter_post_kses');
|
||||
add_filter('excerpt_save_pre', 'wp_filter_post_kses');
|
||||
@ -1386,10 +1391,13 @@ function kses_init_filters() {
|
||||
* @since 2.0.6
|
||||
*/
|
||||
function kses_remove_filters() {
|
||||
// Normal filtering.
|
||||
remove_filter('pre_comment_content', 'wp_filter_kses');
|
||||
// Normal filtering
|
||||
remove_filter('title_save_pre', 'wp_filter_kses');
|
||||
|
||||
// Comment filtering
|
||||
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
|
||||
remove_filter( 'pre_comment_content', 'wp_filter_kses' );
|
||||
|
||||
// Post filtering
|
||||
remove_filter('content_save_pre', 'wp_filter_post_kses');
|
||||
remove_filter('excerpt_save_pre', 'wp_filter_post_kses');
|
||||
|
Loading…
Reference in New Issue
Block a user