Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #22363, comment 32


Ignore:
Timestamp:
11/16/2013 05:00:05 AM (12 years ago)
Author:
p_enrique
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22363, comment 32

    v2 v3  
    22
    331. As for filenames:
    4   - Non-ASCII filenames will break on Windows. This is fundamentally a PHP bug.
     4  - Non-ASCII filenames will break on Windows. This has to do with how PHP interacts with the Windows file system. There might be a workaround that allows filenames to contain characters contained on the current "code page", but other characters will break filenames.
    55  - *nix filesystems allow any characters in filenames (minus the reserved characters, of course).
    66  - WordPress allows uploaded files to have any characters in their names (minus some reserved characters).
    77  - UTF-8 filenames work OK on WordPress on a *nix platform.
    8   - Percent-encoded filenames work on any platform, but make the filename 6 times longer in certain scripts, such as Cyrillic ('%D0%B6' for the character 'ж', for example).
    9   - The maximum file name length under NTFS is 259 characters including the path. 4
    10   - Percent-encoded filenames are not a solution. <img src='ca%C3%B1o.jpg'/> will 404 even though the file 'ca%C3%B1o.jpg' exists, since the server decodes the request to 'caño.jpg'.
     8  - URL-encoded (percent-encoded) filenames work on any platform, but make the filename 6 times longer in certain scripts, such as Cyrillic ('%D0%B6' for the character 'ж', for example).
     9  - The maximum file name length under NTFS is 259 characters including the path.
     10  - URL-encoded filenames are not a solution. <img src='ca%C3%B1o.jpg'/> will 404 even though the file 'ca%C3%B1o.jpg' exists, since the server decodes the request to 'caño.jpg'.
    1111  - remove_accents() is only a partial solution since 1) it has no support at all for non-Latin based scripts and 2) it doesn't do anything with such things as curly quotes, dashes, copyright symbols or other similar things (which are included in sanitize_title_with_dashes())
     12  - sanitize_title() as such is no good for filenames, since it URL-encodes the non-ASCII parts.
    1213
    13142. As for URLs: