Make WordPress Core

Changeset 52821


Ignore:
Timestamp:
03/04/2022 02:09:59 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Add inline comments for non-visible characters in sanitize_title_with_dashes().

This aims to clarify the list of characters that are stripped from URLs or converted to a hyphen.

Follow-up to [51984].

See #47912, #54729.

File:
1 edited

Legend:

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

    r52810 r52821  
    23092309                                '%cc%8c',
    23102310                                // Non-visible characters that display without a width.
    2311                                 '%e2%80%8b',
    2312                                 '%e2%80%8c',
    2313                                 '%e2%80%8d',
    2314                                 '%e2%80%8e',
    2315                                 '%e2%80%8f',
    2316                                 '%e2%80%aa',
    2317                                 '%e2%80%ab',
    2318                                 '%e2%80%ac',
    2319                                 '%e2%80%ad',
    2320                                 '%e2%80%ae',
    2321                                 '%ef%bb%bf',
     2311                                '%e2%80%8b', // Zero width space.
     2312                                '%e2%80%8c', // Zero width non-joiner.
     2313                                '%e2%80%8d', // Zero width joiner.
     2314                                '%e2%80%8e', // Left-to-right mark.
     2315                                '%e2%80%8f', // Right-to-left mark.
     2316                                '%e2%80%aa', // Left-to-right embedding.
     2317                                '%e2%80%ab', // Right-to-left embedding.
     2318                                '%e2%80%ac', // Pop directional formatting.
     2319                                '%e2%80%ad', // Left-to-right override.
     2320                                '%e2%80%ae', // Right-to-left override.
     2321                                '%ef%bb%bf', // Byte order mark.
    23222322                        ),
    23232323                        '',
     
    23282328                $title = str_replace(
    23292329                        array(
    2330                                 '%e2%80%80',
    2331                                 '%e2%80%81',
    2332                                 '%e2%80%82',
    2333                                 '%e2%80%83',
    2334                                 '%e2%80%84',
    2335                                 '%e2%80%85',
    2336                                 '%e2%80%86',
    2337                                 '%e2%80%87',
    2338                                 '%e2%80%88',
    2339                                 '%e2%80%89',
    2340                                 '%e2%80%8a',
    2341                                 '%e2%80%a8',
    2342                                 '%e2%80%a9',
    2343                                 '%e2%80%af',
     2330                                '%e2%80%80', // En quad.
     2331                                '%e2%80%81', // Em quad.
     2332                                '%e2%80%82', // En space.
     2333                                '%e2%80%83', // Em space.
     2334                                '%e2%80%84', // Three-per-em space.
     2335                                '%e2%80%85', // Four-per-em space.
     2336                                '%e2%80%86', // Six-per-em space.
     2337                                '%e2%80%87', // Figure space.
     2338                                '%e2%80%88', // Punctuation space.
     2339                                '%e2%80%89', // Thin space.
     2340                                '%e2%80%8a', // Hair space.
     2341                                '%e2%80%a8', // Line separator.
     2342                                '%e2%80%a9', // Paragraph separator.
     2343                                '%e2%80%af', // Narrow no-break space.
    23442344                        ),
    23452345                        '-',
Note: See TracChangeset for help on using the changeset viewer.