Fixed XF\Http\Upload::analyzeImage does not fully respect getImageExtensionMap


Well-known member
Affected version
XF\Http\Upload::analyzeImage compares the uploaded file's extension against the map returned by getImageExtensionMap but then on the comparing the file's actual image type via getimagesize; a hard-coded list is used.

Using array_flip will generate a map of IMAGETYPE_* constants which can be trivially checked instead of a hard-coded switch statement.

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.6).

Change log:
When analysing images, check image type against image extension map
There may be a delay before changes are rolled out to the XenForo Community.