Make WordPress Core

Changeset 51675


Ignore:
Timestamp:
08/26/2021 07:27:59 PM (5 years ago)
Author:
johnbillion
Message:

Security: Correct the inline docs for the wp_kses_allowed_html filter.

Props peterwilsoncc

Fixes #53597

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r51550 r51675  
    847847 * @param string|array $context The context for which to retrieve tags. Allowed values are 'post',
    848848 *                              'strip', 'data', 'entities', or the name of a field filter such as
    849  *                              'pre_user_description'.
     849 *                              'pre_user_description', or an array of allowed HTML elements and attributes.
    850850 * @return array Array of allowed HTML tags and their allowed attributes.
    851851 */
     
    854854
    855855        if ( is_array( $context ) ) {
     856                // When `$context` is an array it's actually an array of allowed HTML elements and attributes.
     857                $html    = $context;
     858                $context = 'explicit';
     859
    856860                /**
    857861                 * Filters the HTML tags that are allowed for a given context.
     
    859863                 * @since 3.5.0
    860864                 *
    861                  * @param array[]|string $context      Context to judge allowed tags by.
    862                  * @param string         $context_type Context name.
     865                 * @param array[] $html    Allowed HTML tags.
     866                 * @param string  $context Context name.
    863867                 */
    864                 return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' );
     868                return apply_filters( 'wp_kses_allowed_html', $html, $context );
    865869        }
    866870
Note: See TracChangeset for help on using the changeset viewer.