close

Make WordPress Core

Changeset 61882


Ignore:
Timestamp:
03/10/2026 12:27:42 PM (3 days ago)
Author:
johnbillion
Message:

KSES: Optimize PCRE pattern detecting numeric character references.

Props dmsnell, xknown, johnbillion.

File:
1 edited

Legend:

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

    r61565 r61882  
    21192119     * Here, each input is normalized to an appropriate output.
    21202120     */
    2121     $content = preg_replace_callback( '/&#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $content );
    2122     $content = preg_replace_callback( '/&#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $content );
     2121    $content = preg_replace_callback( '/&#(0*[1-9][0-9]{0,6});/', 'wp_kses_normalize_entities2', $content );
     2122    $content = preg_replace_callback( '/&#[Xx](0*[1-9A-Fa-f][0-9A-Fa-f]{0,5});/', 'wp_kses_normalize_entities3', $content );
    21232123    if ( 'xml' === $context ) {
    21242124        $content = preg_replace_callback( '/&([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_xml_named_entities', $content );
Note: See TracChangeset for help on using the changeset viewer.