Make WordPress Core


Ignore:
Timestamp:
06/24/2024 02:40:47 PM (20 months ago)
Author:
audrasjb
Message:

Editor: Sanitize Template Part HTML tag on save.

Props xknown, peterwilsoncc, jorbin, bernhard-reiter, azaozz.

File:
1 edited

Legend:

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

    r58409 r58471  
    47914791 *
    47924792 * @since 2.5.0
     4793 * @since 6.5.5 Allow hyphens in tag names (i.e. custom elements).
    47934794 *
    47944795 * @param string $tag_name
     
    47964797 */
    47974798function tag_escape( $tag_name ) {
    4798     $safe_tag = strtolower( preg_replace( '/[^a-zA-Z0-9_:]/', '', $tag_name ) );
     4799    $safe_tag = strtolower( preg_replace( '/[^a-zA-Z0-9-_:]/', '', $tag_name ) );
    47994800    /**
    48004801     * Filters a string cleaned and escaped for output as an HTML tag.
Note: See TracChangeset for help on using the changeset viewer.