WordPress.org

Make WordPress Core

Ticket #33756: 33756.diff

File 33756.diff, 1.4 KB (added by ericlewis, 4 years ago)
  • src/wp-includes/formatting.php

     
    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.
    14481447 *
     1448 * If the sanitized version of $title is empty, $fallback_title will be returned.
     1449 *
    14491450 * @since 1.0.0
    14501451 *
    14511452 * @param string $title          The string to be sanitized.
     
    14911492}
    14921493
    14931494/**
    1494  * Sanitizes a title, replacing whitespace and a few other characters with dashes.
     1495 * Sanitizes a string. Output is limited to to alphanumeric characters,
     1496 * underscore (_) and dash (-).
    14951497 *
    1496  * Limits the output to alphanumeric characters, underscore (_) and dash (-).
    1497  * Whitespace becomes a dash.
     1498 * Various characters (including whitespace) are convered to dashes.
    14981499 *
    14991500 * @since 1.2.0
    15001501 *
     
    15201521        }
    15211522
    15221523        $title = strtolower($title);
    1523         $title = preg_replace('/&.+?;/', '', $title); // kill entities
     1524        // Remove HTML entities.
     1525        $title = preg_replace('/&.+?;/', '', $title);
    15241526        $title = str_replace('.', '-', $title);
    15251527
    15261528        if ( 'save' == $context ) {