Last modified: 2014-05-22 19:12:59 UTC
currently, the file extensions that cause an external link to be rendered as an image if $wgAllowExternalImages is true is hardcoded in Parser::EXT_IMAGE_REGEX. It would be much nicer if it was derived from $wgFileExtensions. Not all allowed file extensions are images, but the ones that are can be identified using MimeMagic::guessTypesForExtension($mime) and MimeMagic::findMediaType($mime).
I'm not sure there's not much benefit to using $wgFileExtensions; $wgFileExtensions controls what you can locally upload so that it can be verified, managed, rendered into thumbnails, etc. None of that happens with external images -- they're just put into an <img> so there's no interpretation or rendering that would depend on the file type. We don't even get a chance to control the image's size... :( I'd actually rather drop $wgAllowExternalImages entirely and replace it, if it's needed, with a smarter way of dealing with externally sourced images; guessing imageness from URLs has never been safe or complete to begin with. Legit use of externally-referenced images is probably better off being done as some sort of extension that lets you explicitly size, place, and caption them.