Make WordPress Core


Ignore:
Timestamp:
03/13/2026 12:41:24 PM (5 months ago)
Author:
johnbillion
Message:

Grouped backports for the 5.0 branch.

  • XML-RPC: Switch to wp_safe_remote() when fetching a pingback URL.
  • HTML API: Prevent WP_HTML_Tag_Processor instances being unserialized and add some extra logic for validating pattern and template file paths.
  • KSES: Optimize PCRE pattern detecting numeric character references.
  • Customize: Improve escaping approach used for nav menu attributes.
  • Media: Ensure the attachment parent is accessible to the user before showing a link to it in the media manager.
  • Administration: Ensure client-side templates are only detected when they're correctly associated with a script tag.
  • Filesystem API: Don't attempt to extract invalid files from a zip when using the PclZip library.

Merges [61879-61884,61886-61887,61890,61913] to the 5.0 branch.

Props johnbillion, xknown, dmsnell, jorbin, peterwilson, desrosj, westonruter, jonsurrell, aurdasjb.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/src/wp-includes/kses.php

    r46915 r62003  
    544544        $allowed_protocols = wp_allowed_protocols();
    545545        $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
    546        
     546
    547547        // Preserve leading and trailing whitespace.
    548548        $matches = array();
     
    556556                $string = substr( $string, strlen( $lead ), -strlen( $trail ) );
    557557        }
    558        
     558
    559559        // Parse attribute name and value from input.
    560560        $split = preg_split( '/\s*=\s*/', $string, 2 );
     
    593593                $vless = 'y';
    594594        }
    595        
     595
    596596        // Sanitize attribute by name.
    597597        wp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html );
     
    11481148                $xhtml_slash = '';
    11491149        }
    1150        
     1150
    11511151        // Split it
    11521152        $attrarr = wp_kses_hair_parse( $attr );
     
    11581158        array_unshift( $attrarr, $begin . $slash . $elname );
    11591159        array_push( $attrarr, $xhtml_slash . $end );
    1160        
     1160
    11611161        return $attrarr;
    11621162}
     
    14731473        $string = str_replace('&', '&', $string);
    14741474
    1475         // Change back the allowed entities in our entity whitelist
    1476         $string = preg_replace_callback('/&([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string);
    1477         $string = preg_replace_callback('/&#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string);
    1478         $string = preg_replace_callback('/&#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string);
     1475        $string = preg_replace_callback( '/&([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );
     1476        $string = preg_replace_callback( '/&#(0*+[1-9][0-9]{0,6});/', 'wp_kses_normalize_entities2', $string );
     1477        $string = preg_replace_callback( '/&#[Xx](0*+[1-9A-Fa-f][0-9A-Fa-f]{0,5});/', 'wp_kses_normalize_entities3', $string );
    14791478
    14801479        return $string;
Note: See TracChangeset for help on using the changeset viewer.