No Code Attached Yet bug
avatar brianteeman
brianteeman
25 Jan 2023

Saw this on facebook earlier today and then 10 minutes later had the same error report from a client

When opening media manager

Error Property 'mime_type' of argument 'item' of event onFetchMediaItems has a wrong item. Valid: string

The problem is caused if php does not have fileinfo module.

I am fine with that being a requirement but it needs to have better error messages

avatar brianteeman brianteeman - open - 25 Jan 2023
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jan 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Jan 2023
avatar dgrammatiko
dgrammatiko - comment - 26 Jan 2023

I am fine with that being a requirement but it needs to have better error messages

When I was coding #39586 I noted that the code for extracting the mime_type could be improved with the simple installation of one of the most popular composer packages (my preference is https://github.com/thephpleague/mime-type-detection but the most popular is the symphony one: https://packagist.org/packages/symfony/mime). On another project to strengthen security we sniff the extension from the file header bytes with some code like: https://gist.github.com/GiantZOC/db1d30b31ffb9d8ca73b6c4f4fe991df#file-mimetypeverification-js-L30-L80 and my recommendation would be that Joomla should also follow the same path. The fileinfo module then might not be a hard dependency.

avatar brianteeman
brianteeman - comment - 26 Jan 2023

Personally I am file with fileinfo being a requirement as long as there is a more helpful error message

avatar brianteeman brianteeman - close - 2 Feb 2023
avatar brianteeman
brianteeman - comment - 2 Feb 2023

Closed see #39777

avatar brianteeman brianteeman - change - 2 Feb 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-02-02 13:56:05
Closed_By brianteeman
avatar brianteeman brianteeman - change - 3 Feb 2023
Status Closed New
Closed_Date 2023-02-02 13:56:05
Closed_By brianteeman
avatar brianteeman brianteeman - reopen - 3 Feb 2023
avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar alikon
alikon - comment - 18 Apr 2023

based upon on how much php stack in the wild, lacks of phpfileinfo module
we should choose our poison

i don't like to introduce dependencies if it can be avoided

better to document this "hard" requirement ?

Add a Comment

Login with GitHub to post a comment