Skip to content

Uploading a media with incorrect extension throws error in MediaStreamController #3719

@alexander-schranz

Description

@alexander-schranz
Q A
Bug? yes
New Feature? no
Sulu Version 1.6.12

Actual Behavior

When you upload a media which contains a . in its filename but no extension the MediaStreamController pathcleanup will fail for example:

fitness-seasons.agency--C-&-C--Rodach,-Johannes.jpg

Expected Behavior

We should use the ExtensionGuesser from Symfony to get extension from the mimetype instead of using the pathinfo function.

Steps to Reproduce

  1. Upload a file without a extension with the following name fitness-seasons.agency--C-&-C--Rodach,-Johannes.jpg

Possible Solutions

Use ExtensionGuesser from symfony to get the correct extension by mimetype instead of pathinfo.

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