Skip to content

File naming (file extensions) changed between 2.4.1 and 2.4.2 #1479

Closed
@jxmallett

Description

BC Break Report

Q A
BC Break yes
Version 2.4.2

Summary

The handling of file extensions changed in 2.4.2 with this commit 4962a3e (Specifically the changes to the FileExtensionTrait)

Previous behavior

Previously the file extension was based on the extension of the original name of the uploaded file.

Current behavior

The original file extension is now ignored and the extension is 'guessed' based on the mime type.

How to reproduce

  • Create a zip file (of any file) and name it zip-file.txt.
  • Check the mime type in bash with file -i zip-file.txt. It should return application/zip.
  • Upload zip-file.txt using vich uploader. I am using the UniqidNamer, but any namer that uses FileExtensionTrait is affected.
  • Observe the .txt extension is removed and replaced with .zip

I know the commit was made to address a potential security issue, but I thought the behaviour change was worth reporting.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions