Make WordPress Core


Ignore:
Timestamp:
07/24/2020 06:01:48 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Media: Remove accents in sanitize_file_name().

This brings some consistency with sanitize_title() and sanitize_user().

Props tar.gz, NumidWasNotAvailable, juliobox, p_enrique, cristovaov, zodiac1978, mikeschroder, markoheijnen, chriscct7, swissspidy, DrProtocols, pento, gitlost, joemcgill, dustinbolton, programmin, Vayu, MaximeCulea, lucasbustamante, nilovelez, RavanH, audrasjb, SergeyBiryukov.
See #22363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/SanitizeFileName.php

    r48596 r48603  
    2222
    2323        /**
     24         * @ticket 22363
     25         */
     26        function test_removes_accents() {
     27                $in  = 'àáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ';
     28                $out = 'aaaaaaaeceeeeiiiinoooooouuuuyy';
     29                $this->assertEquals( $out, sanitize_file_name( $in ) );
     30        }
     31
     32        /**
    2433         * Test that spaces are correctly replaced with dashes.
    2534         *
    2635         * @ticket 16330
    2736         */
    28         function test_replace_spaces() {
     37        function test_replaces_spaces() {
    2938                $urls = array(
    3039                        'unencoded space.png'  => 'unencoded-space.png',
    … …  
    5968        }
    6069
    61         function test_replaces_unnammed_file_extensions() {
     70        function test_replaces_unnamed_file_extensions() {
    6271                // Test filenames with both supported and unsupported extensions.
    6372                $this->assertEquals( 'unnamed-file.exe', sanitize_file_name( '_.exe' ) );
    … …  
    6574        }
    6675
    67         function test_replaces_unnammed_file_extensionless() {
     76        function test_replaces_unnamed_file_extensionless() {
    6877                // Test a filenames that becomes extensionless.
    6978                $this->assertEquals( 'no-extension', sanitize_file_name( '_.no-extension' ) );
Note: See TracChangeset for help on using the changeset viewer.