WordPress.org

Make WordPress Core

Ticket #33756: 33756.2.diff

File 33756.2.diff, 1.5 KB (added by swissspidy, 4 years ago)
  • src/wp-includes/formatting.php

    diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
    index be8ea6c..4e82133 100644
    function sanitize_key( $key ) { 
    14401440}
    14411441
    14421442/**
    1443  * Sanitizes a title, or returns a fallback title.
     1443 * Sanitizes a string for use as a slug in a URL.
    14441444 *
    14451445 * Specifically, HTML and PHP tags are stripped. Further actions can be added
    1446  * via the plugin API. If $title is empty and $fallback_title is set, the latter
    1447  * will be used.
     1446 * via the plugin API. If the sanitized version of $title is empty,
     1447 * `$fallback_title` will be returned.
    14481448 *
    14491449 * @since 1.0.0
    14501450 *
    function sanitize_title_for_query( $title ) { 
    14911491}
    14921492
    14931493/**
    1494  * Sanitizes a title, replacing whitespace and a few other characters with dashes.
     1494 * Sanitizes a string.
    14951495 *
    1496  * Limits the output to alphanumeric characters, underscore (_) and dash (-).
    1497  * Whitespace becomes a dash.
     1496 * Output is limited to to alphanumeric characters, underscore (_) and dash (-).
     1497 * Various characters (including whitespace) are convered to dashes.
    14981498 *
    14991499 * @since 1.2.0
    15001500 *
    function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa 
    15201520        }
    15211521
    15221522        $title = strtolower($title);
    1523         $title = preg_replace('/&.+?;/', '', $title); // kill entities
     1523        // Remove HTML entities.
     1524        $title = preg_replace('/&.+?;/', '', $title);
    15241525        $title = str_replace('.', '-', $title);
    15251526
    15261527        if ( 'save' == $context ) {