Make WordPress Core

Changeset 58361

Timestamp:
06/07/2024 04:48:42 PM (2 months ago)
Author:
westonruter
Message:

General: Fix array format for allowed HTML passed into wp_kses() for wp_trigger_error().

Kses requires an associative array of allowed HTML.

See #57686. Follow-up to [56707].

Props thelovekesh, westonruter.
Fixes #61318.

Location:
trunk
Files:
2 edited

Legend:

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

    r58278 r58361  
    60696069        $message,
    60706070        array(
    6071             'a' => array( 'href' ),
    6072             'br',
    6073             'code',
    6074             'em',
    6075             'strong',
     6071            'a' ),
     6072            'br',
     6073            'code',
     6074            'em',
     6075            'strong',
    60766076        ),
    60776077        array( 'http', 'https' )
  • trunk/tests/phpunit/tests/functions/wpTriggerError.php

    r57735 r58361  
    8383    public function data_should_trigger_error() {
    8484        return array(
    85             'function name and message are given' => array(
     85            'function name and message are given' => array(
    8686                'function_name'    => 'some_function',
    8787                'message'          => 'expected the function name and message',
    8888                'expected_message' => 'some_function(): expected the function name and message',
    8989            ),
    90             'message is given'                    => array(
     90            'message is given'                    => array(
    9191                'function_name'    => '',
    9292                'message'          => 'expect only the message',
    9393                'expected_message' => 'expect only the message',
    9494            ),
    95             'function name is given'              => array(
     95            'function name is given'              => array(
    9696                'function_name'    => 'some_function',
    9797                'message'          => '',
    9898                'expected_message' => 'some_function(): ',
    9999            ),
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
    100115        );
    101116    }
Note: See TracChangeset for help on using the changeset viewer.