Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/20/2012 12:59:10 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Add forum specific kses allowed tags to common component. Tweak topic and reply content filters to use these new kses functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/common/template-tags.php

    r4579 r4604  
    22422242     * @since bbPress (r2780)
    22432243     *
    2244      * @uses allowed_tags() To get the allowed tags
     2244     * @uses bbp_kses_allowed_tags() To get the allowed tags
    22452245     * @uses apply_filters() Calls 'bbp_allowed_tags' with the tags
    22462246     * @return string HTML allowed tags entity encoded.
    22472247     */
    22482248    function bbp_get_allowed_tags() {
    2249         return apply_filters( 'bbp_get_allowed_tags', allowed_tags() );
     2249
     2250        $allowed = '';
     2251
     2252        foreach ( (array) bbp_kses_allowed_tags() as $tag => $attributes ) {
     2253            $allowed .= '<' . $tag;
     2254            if ( 0 < count( $attributes ) ) {
     2255                foreach ( array_keys( $attributes ) as $attribute ) {
     2256                    $allowed .= ' ' . $attribute . '=""';
     2257                }
     2258            }
     2259            $allowed .= '> ';
     2260        }
     2261
     2262        return apply_filters( 'bbp_get_allowed_tags', htmlentities( $allowed ) );
    22502263    }
    22512264
Note: See TracChangeset for help on using the changeset viewer.