Contact images broken when file extension is capitalised (e.g ..JPG) "Supplied mime-type does not match file extension"
We have a number of existing contact images that are now displayed as broken links. These images all have uppercase file extensions ".JPG". This error is displayed: "Supplied mime-type does not match file extension".
This behaviour commenced with 5.13.4 and is still present in 5.14.0.
This error message looks to have been introduced commit b5230444 in civicrm/CRM/Core/Page/File.php
.
Trying to debug this, in run()
for one of my broken images with extension .JPG:
$extension
contains JPG
in uppercase
$candidateExtensions
contains ['0' => 'jpeg', '1' => 'jpg', '2' => 'jpe']
all in lowercase.
What is puzzling me is that I cannot reproduce this on dmaster but yet I do still see the problem when I test locally with the master code and I can't see any relevant changes. I'm using Joomla 3.9.8 so it could be CMS-dependent but it's not immediately obvious how.