Ensure portability of created file names

Created on 4 August 2015, almost 10 years ago
Updated 23 May 2025, 7 days ago

file_create_filename() in file.inc does a check as to whether Drupal is running in Windows before eliminating characters that cannot be used in Windows file names. It would be better for site portability if these characters were always removed.

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

file.module

Created by

πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

    There doesn't appear to be any corresponding code in the file module for Drupal 11. Closing as obsolete.

  • πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I found the code in core using git, git log -S'are not allowed in W'. It is at https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co.... So, restoring status.

  • πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

    @quietone Thank you! I had only looked in the module, not in the library.

    @smustgrave I'm not sure what additional information you need. The code is still in 11.x and is therefore potentially an issue. Of course, the patch is out of date.

    I just did a test on simplytest.me, which is apparently not a Windows machine.

    • File name on my Mac: file name with special chars /*?"<>|.txt
    • File name once uploaded to simplytest.me: file%20name%20with%20special%20chars%20%3A*%3F%2522%3C%3E%7C.txt
    • File name as shown in the Windows Edge address bar: file%20name%20with%20special%20chars%20%3A*%3F%2522<>%7C.txt
    • File name as downloaded to Windows 11: file name with special chars ___%22___.txt

    So, it's not an issue that files originally stored on a non-Windows machine can't be accessed by a Windows machine.

    My concern would be if the site were moved from a non-Windows host to a Windows host that the files would no longer be accessible. However, I have not tested this and, as QA not developer, don't have a way to test this hypothesis.

Production build 0.71.5 2024