Users Can Post Bad HTML Content
-
Hi, One of my users discovered that they can post potentially malicious HTML into the bbPress reply box.
I once added the code below to my functions.php file, because users were not able to use Left-align, Centre, and Right-align for text, but I fear maybe it’s now given too many HTML permissions.
Could anyone please look at this code and let me know if something needs to be changed (maybe some trues switched to falses)?
Thank you so much, Sam
add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' ); function ntwb_bbpress_custom_kses_allowed_tags() { return array( // Links 'a' => array( 'class' => true, 'href' => true, 'title' => true, 'rel' => true, 'class' => true, 'target' => true, ), // Quotes 'blockquote' => array( 'cite' => true, ), // Div 'div' => array( 'class' => true, ), // Span 'span' => array( 'class' => true, 'style' => true, ), // Paragraph 'p' => array( 'class' => true, 'style' => true, ), // Code 'code' => array(), 'pre' => array( 'class' => true, ), // Formatting 'em' => array(), 'strong' => array(), 'del' => array( 'datetime' => true, ), // Lists 'ul' => array(), 'ol' => array( 'start' => true, ), 'li' => array(), // Images 'img' => array( 'class' => true, 'src' => true, 'border' => true, 'alt' => true, 'height' => true, 'width' => true, ), // Tables 'table' => array( 'align' => true, 'bgcolor' => true, 'border' => true, ), 'tbody' => array( 'align' => true, 'valign' => true, ), 'td' => array( 'align' => true, 'valign' => true, ), 'tfoot' => array( 'align' => true, 'valign' => true, ), 'th' => array( 'align' => true, 'valign' => true, ), 'thead' => array( 'align' => true, 'valign' => true, ), 'tr' => array( 'align' => true, 'valign' => true, ) ); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.