Skip to content

FileUpload::getSanitizedName returns wrong file extension #239

@hubipe

Description

@hubipe

Version: 3.3.0

Bug Description

When uploading file.xls, method getSanitizedName() returns file.doc instead of file.xls.

Steps To Reproduce

Create a file upload and upload Microsoft Excel file with the old extension .xls. Dump FileUpload::getSanitizedName().

Expected Behavior

Method for returning sanitize name should return file.xls

Possible Solution

I've noticed, that the behavior of this method changed in the 3.2.4. The intention of the change was probably to return the correct extension for the image file uploads, but this change broke backwards compatibility for other types of files. Possible solution is to use finfo_file only for images?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions